angular-2-local-storage
LocalStorageService for Angular with mostly the same API (and most of the code) from angular-local-storage.
AoT compatible.
Differences
- No events broadcast on $rootScope - LocalStorageService exposes observables for
errors$
,removeItems$
,setItems$
andwarning$
if you really need something to happen when something happens. - The
bind
function doesn't work anymore (there is a stub so this can still be a drop-in, but it'll do nothing).
Install
npm install angular-2-local-storage
Usage
You can optionally configure the module:
;
Then you can use it in a component:
;
Configuration options
import { ILocalStorageServiceConfig } from 'angular-2-local-storage';
for type information about the configuration object.