Angular 2 how to send events from grandchild to parent component? Angular 2 how to send events from grandchild to parent component? angular angular

Angular 2 how to send events from grandchild to parent component?


Whenever you don't have a direct parent → child relationship, use a (shared) service to share data and/or send events.

Inside the service, use a Subject or an Observable to accomplish this.

The cookbook has an example of how to use a Subject to achieve bi-directional communication between components.

This SO post, Delegation: EventEmitter or Observable in Angular2, has an example of how to use an Observable.