| Start |
|---|
| Using ngStorage to share data Firstly, include the ngStorage (opens new window) source in your index.html. An example injecting
Suppose if
You can also use the For example: |
| Sharing data from one controller to another using service We can create a Service : Controllers : Here, we can see that RemarksA very common question when working with Angular is how to share data between controllers. Using a service (opens new window) is the most frequent response and this is a simple example demonstrating a factory (opens new window) pattern to share any type of data object between two or more controllers. Because it is a shared object reference, an update in one controller will be immediately available in all other controllers using the service. Note that both service and factory and both providers (opens new window). |
Read Article
https://develop.horje.com/learn/1434/reference