I have a simple setup. I use a routing component with several child components that load dynamically depending on the route. I would like some of these child components to have data binding with the routing parent.
I will add the @Output () property for the child, but how can I get the routing parent to listen for the events that this event emitter emits?
Usually in a template with a statically defined component, I will do something like this:
<child (myevent)="handleEvent($event)">
and the parentEvent method of the parent will handle the event.
But since routing dynamically inserts components, this is not possible. Is there any way to make it work? I know that I can use the service to achieve the same result, but I would like to avoid this in this case.
thank
angular angular2-template angular2-routing
laagland Mar 22 '16 at 15:42 2016-03-22 15:42
source share