I used Angular2 dynamic component loader. Everything works well.
My dynamically loaded component emits events, but I cannot catch it anywhere.
Parent code:
this.dcl.loadAsRoot(SomeComponent, "#dynamiccomponenthere", this.injector)
Parent template:
<div id="dynamiccomponenthere" (somecustomevent)="someFunc()"></div>
Child:
... this.somecustomevent.emit(data) ...
* SOLUTION: (thanks Gunther) *
cmp.instance['somecustomevent'].subscribe(ev => { this.consoleLog(ev)
Teddy source share