0

I have a component generator which is used to generate components on the fly and render them within its template. Any events emitted by a component needs to be caught by the component generator, data needs to be processed and processed data needs to be relayed to the next control.

I am working on Angular6 and although i have used the subscribe method in the code, the subscribed handler doesnt seem to be receiving the emitted event.

compRef.instance.selectedEntryEvent.subscribe(this.relaySelectionToNextComponent);

Following is the stackblitz link to the simple component generator code :- https://stackblitz.com/edit/angular-componentgenerator

Let me know your thoughts.

Thanks

alevi.dcosta
  • 143
  • 2
  • 12

1 Answers1

0

Figured out the way to register the subscribe handler. All i had to do was:- compRef.instance.selectedEntryEvent.subscribe(val => this.relaySelectionToNextComponent(val));

Refer to the same stackblitz link :- https://stackblitz.com/edit/angular-componentgenerator

alevi.dcosta
  • 143
  • 2
  • 12