johnpapa / angular-tour-of-heroes

Angular - Tour of Heroes - The Next Step after Getting Started
Apache License 2.0
826 stars 1.45k forks source link

how to add event emitters from heroes-detail #126

Closed r0lan2 closed 6 years ago

r0lan2 commented 7 years ago

Hi, I would like to communicate HeroDetailComponent with other component using events. basically I have three components: HeroesComponent HeroDetailComponent and HeroesClientComponent what will the parent of the first two ones. I know in you example you are using routing and one dataservice to get/set the data... is possible have a shared service to help to communicate these three components?

can you see my repo? there you will see a shared service reponsible to emite events for save and delete. https://github.com/r0lan2/angular-tour-of-heroes The issue what currently I have is that event are raised more than one time (i suspect is something with the routing between pages) here my issue: https://stackoverflow.com/questions/44464655/angular-2-app-events-are-raised-multiple-times thank you in advance.

johnpapa commented 6 years ago

better for stackoverflow