3 ms·
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
by kitbrennan 12y ago
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.