Igor Ilić
Igor Ilić

Reputation: 196

Pass data upstream to app component

Is it possible to pass data two or more levels upstream from Child Component to App Component?

enter image description here

Upvotes: 0

Views: 333

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657761

Use a shared service like explained in https://angular.io/docs/ts/latest/cookbook/component-communication.html

Provide the service once at the root component and it is avialable throughout the application and you can use it (for example also with observables) to communicate in both directions, similar to an event bus.

Upvotes: 1

Related Questions