Hi Sander, In the latest version of your code, the component and a corresponding service. Standard approach, very clean.
So the component is displaying data itself and from the service. How does that extrapolate to one component displaying data from number of other components? You are not implying all of the components having the same service injected? They components almost need to share the same "singleton" service. Can you elaborate please? On Thursday, July 20, 2017 at 9:56:46 PM UTC-7, Sander Elias wrote: > > Hi Reza, > > Hmm, Somehow my earlier response to this got lost. Well, I need to type it > up again then :) > I refactored the sample a bit, so it pushed all the "business" logic to > where it belongs, inside the service. In your case you can do the same, and > inject the service(s) where you need them. The sample has just 1 service, > but you can have as many as you need. Also, remember, you can inject > services into services. Ideally The components should have no logic at all. > they are just there to hook up your view. > Check the repo, to see the changes I did. > > Regards > Sander > -- 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.
