AngularJS: Sharing Data Between Controllers
A service can be used to share data between controllers.
The service is declared by using the factory method on a module. The method is provided with a name and a factory callback that will create the service when needed.
However, services are singletons: everybody is given a reference to the same instance of the service, and that's how data can be shared by using them.














