1

Im having some angular custom elements. I want to create instance of those and get their model values in its parent component. The input, output methods not helping. Could you please suggest me a way. Thanks in advance.

Create Custom ELement

const PopupElement = createCustomElement(PopupComponent, {injector});
customElements.define('popup-element', PopupElement);

The custom element is used in a parent element

const popupEl: NgElement & WithProperties<PopupComponent> = document.createElement('popup-element') as any;

popupEl.addEventListener('closed', () => document.body.removeChild(popupEl));

popupEl.message = message;

document.body.appendChild(popupEl);

Now i want the parent element to get the new value of message.

How to achieve this?

Stark Buttowski
  • 1,799
  • 2
  • 10
  • 21

0 Answers0