One can use Output()
decorator to emit the event from the child component so that the parent component can catch it. What I need is to catch an event emitted by any child component, which is not necessarily a direct child of a given component.
Let ComponentTwo
be a component which emits the event. If the app has the following structure: App -> ComponentTwo
, then we can easily catch the event emitted by ComponentTwo
. But if we consider structure like App -> ComponentOne -> ComponentTwo
, then we can't catch the emitter directly.
Here is a plunker that illustrates the problem.
So is there a way to sort of propagate event to all parent components? Thanks.