Hey there, I'm an enthusiastic Frontend Developer who'd been writing AngularJS for some time a few years ago and is now getting started with Angular 5. I mostly feel comfortable getting into it but am not sure how to handle communication between components correctly. Let me explain:
I have *<app-product>* which uses *<app-button>*. *<app-button>* fires a custom event via *@Output*. *<app-product> *will react to that event using an *ProductgridService* which is provided by its parent. I have *<app-productgrid-one>* and *<app-productgrid-two> *which both use a few* <app-product>.* Clicking *<app-button>* in either *<app-productgrid-one>* or *<app-productgrid-two>* will only modify *<app-productgrid-one>*. Using *rxjs* I subscribe both to get informed when the click occurs but how, in my callback, do I figure out that I am currently handling *<app-productgrid-one> *and not *<app-productgrid-two>**?* The only idea I have at the moment is to further bubble the custom event from *<app-product>* to *<app-productgrid-one>* and *<app-productgrid-two>* and *subscribe* there using different callbacks but that feels really hacky to me. What am I doing wrong? -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
