Give it a try

{{localStorageDemoValue}}

{{storageType}} value

The Angular Local Storage Module is meant to be a plug-and-play Angular module for accessing the browsers Local Storage API.

Angular Local Storage offers you access to the browser local storage API through Angular but also allows has the following features:

Usage

Dependencies:
JS Example
var YourCtrl = function($scope, localStorageService, ...) {
  // To add to local storage
  localStorageService.add('localStorageKey','Add this!');
  // Read that value back
  var value = localStorageService.get('localStorageKey');
  // You can also play with cookies the same way
  localStorageService.cookie.add('localStorageKey','I am a cookie value now');
}

API Access

Call Arguments Action Returns
isSupported n/a Checks the browsers support for local storage Boolean for success
add key, value Adds a key-value pair to the browser local storage Boolean for success
get key Gets a value from local storage Stored value
remove key Removes a key-value pair from the browser local storage Boolean for success
clearAll n/a Warning Removes all local storage key-value pairs for this app. Boolean for success
cookie add | get | remove | clearAll Each function within cookie uses the same arguments as the coresponding local storage functions n/a