Currently I am using a service to perform an action, namely retrieve data from the server and then store the data on the server itself.
Instead of this, I want to put the data into local storage instead of storing it on the server. How do I do this?
There is one more alternative module which has more activity than
ngStorage
angular-local-storage:
https://github.com/grevory/angular-local-storage
this is a bit of my code that stores and retrieves to local storage. i use broadcast events to save and restore the values in the model.
I authored (yet another) angular html5 storage service. I wanted to keep the automatic updates made possible by
ngStorage
, but make digest cycles more predictable/intuitive (at least for me), add events to handle when state reloads are required, and also add sharing session storage between tabs. I modelled the API after$resource
and called itangular-stored-object
. It can be used as follows:API is here.
Repo is here.
Hope it helps somebody!