Use bower to install it: bower install angular-local-storage --save
Use tsd to install the TypeScript definition file: tsd query angularlocalstorage --action install
Include the js file in your index.html:
Add the 'LocalStorageModule' to your angular module and configure its name (in app.ts): angular.module('csWebApp', ['LocalStorageModule'].config(localStorageServiceProvider => { localStorageServiceProvider.prefix = 'ZorgOpDeKaart'; })
Inject it into your controller (public static $inject = ['localStorageService']: constructor(private $localStorageService : ng.localStorage.ILocalStorageService) {}
Use it (before you set it, check whether you already have it):
if ($localStorageService.get('numberOfItems') === null)
$localStorageService.set('numberOfItems', 25); // You first need to set the key
$localStorageService.bind($scope, 'numberOfItems');