localStorageService is an AngularJS based service module which can be used to store and retrieve data from local storage of browser.
AngularJS verison 1.0.5+
Add a <script>
to your index.html
:
<script src="/path_to_js_file/localStorageModule.js"></script>
Create instance of service in Controller or js file:
var storage = localStorageService.create();
Give prefix to keys (optional):
storage.prefix = "Prefix";
this is optional but can be handy when you are using this service in multiple controllers
Store Value
storage.set("Key","Value to Store");
Get Value
storage.get("Key");
Remove Value
storage.remove("Key");
Clear Everything
storage.removeAll();