Re:Angular-data: data store and caching for Angular.js
by kitbrennan on Wednesday September 10, 2014 @03:07PM
(#8298407)
A simple example would be storing data on your 'logged in user' on a large application that has multiple controllers/services.
A scope only extends as far as a particular controller/service. If you wanted every controller/service to have access to that user's data (eg. that user's ID), you would create a service that would store that data, and then inject that service into each place you need to access the data.
A scope only extends as far as a particular controller/service. If you wanted every controller/service to have access to that user's data (eg. that user's ID), you would create a service that would store that data, and then inject that service into each place you need to access the data.