Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 797 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 797 Bytes

Angular $cookieStore like API for localStorage Want to use localStorage in your angular Apps with the same API than $cookieStore? $localStore is for you

install

bower install angular-local-store --save

In your app module definition, add ngLocalStore as a dependency

angular.module('myApp', ['ngLocalStore']);

use

$localStore's API is the same than the $cookieStore API You can store strings, arrays, objects...

$localStore.put('car', {brand: 'tesla', wheels: 4});

var car = $localStore.get('car');

$localStore.remove('car');

clear

$localStore adds an extra #clear method to remove every key from localStorage (similar to localStorage.clear())

$localStore.clear();