@@ -78,6 +78,7 @@ myApp.config(function (localStorageServiceProvider) {
7878 .setPrefix (' yourAppName' );
7979});
8080```
81+ <<<<<<< HEAD
8182###setStorageType
8283You could change web storage type to localStorage or sessionStorage<br />
8384** Default storage:** ` localStorage `
@@ -217,16 +218,21 @@ myApp.controller('MainCtrl', function($scope, localStorageService) {
217218###bind
218219Bind $scope key to localStorageService.
219220** Usage:** ` localStorageService.bind(scope, property, value[optional], key[optional]) `
220- *** key:*** The corresponding key used in local storage
221+ *** key:*** The corresponding key used in local storage
222+ ** Returns:** deregistration function for this listener.
221223``` js
222224myApp .controller (' MainCtrl' , function ($scope , localStorageService ) {
223225 // ...
224226 localStorageService .set (' property' , ' oldValue' );
225- localStorageService .bind ($scope, ' property' );
227+ var unbind = localStorageService .bind ($scope, ' property' );
226228
227229 // Test Changes
228- $scope .property = ' newValue' ;
229- console .log (localStorageService .get (' property' )) // newValue;
230+ $scope .property = ' newValue1' ;
231+ console .log (localStorageService .get (' property' )) // newValue1;
232+ // unbind watcher
233+ unbind ();
234+ $scope .property = ' newValue2' ;
235+ console .log (localStorageService .get (' property' )) // newValue1;
230236 // ...
231237});
232238```
@@ -302,7 +308,7 @@ myApp.controller('MainCtrl', function($scope, localStorageService) {
302308});
303309```
304310
305- Check out the full demo and documentation at http://gregpike.net/demos/angular-local-storage/demo.html
311+ Check out the full demo at http://gregpike.net/demos/angular-local-storage/demo.html
306312
307313##TO DO:
308314- Expand Readme
0 commit comments