Instantiate Global Services In Angularjs
I am currently developing a new system at work, using AngularJS. And the application currently has many Controllers, Services and Directives, and many dependencies. The system has
Solution 1:
Services are singletons in Angular, so you should just inject them where ever you need them. It's not necessary to inject them in to an ancestor and propegate it down. Just inject it directly into the child as well. There is only one instance of the service regardless, so why not just make it easier that way?
Post a Comment for "Instantiate Global Services In Angularjs"