Currently I have two ideas for passing data from one view to other in angulajs and using "ui.router".
- Set the data using local storage in one view and then retrieve that data on next view .(This does not seem to be an efficient way)
- Create a service and share the same object created using service with both the views. I have seen second idea example over here . But I don't know how services are able to share data between views. If any experienced Angularjs programmer can help me understand this concept it would be a lot of help to me. I have seen this angular-share-data-between-controllers it tell how you can share data but does not explain how it works behind the scene. I want to know how it works