I have a simple setup. I'm using a routing component with multiple child components which are loaded dynamically depending on the route. I'd like for some of these child components to have data-binding with its routing parent.
I'll add an @Output() property to the child, but how can I make the routing parent listen for the events that this event-emitter emits?
Normally in a template with a statically defined component I'll do something like this:
<child (myevent)="handleEvent($event)">
and the parent's handleEvent method will handle the event.
But since routing insert the components dynamically, this is not possible. Is there a way to make it work? I know I can use a service to achieve the same result, but I'd like to avoid that in this case.
Thanks