Hi Reza,

Yes, inject the same service in the components where you need them. They 
are indeed singletons. (hmm, yeah, not 100% technically but close enough!)
Do not forget, you can inject services in services, and make sure they 
don't grow into a unmaintainable mess!

There are more ways to get this done. ngrx(redux variant for angular) comes 
to mind. Observables, and some more solutions are also an option. However, 
I prefer simple solutions, as long as it's possible. In my book, the code 
that's easiest to debug, is the code not written. Less code wins. 
Perfection is only achieved if there is nothing left that can be removed ;)

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.

Reply via email to