Usage example for a .bind deregistration function

master
Den Teresh 10 years ago
parent 887b682815
commit 5948d2be36

@ -46,10 +46,13 @@ Usage: localStorageService.bind(scope, scopeKey, def, lsKey);
$scope.anArtist = {'firstname':'Pablo', 'lastname':'Picasso'};
// Bind to local storage service
localStorageService.bind($scope, 'anArtist', $scope.anArtist, 'specialArtist');
var lsUnbind = localStorageService.bind($scope, 'anArtist', $scope.anArtist, 'specialArtist');
// get bound data:
console.log(localStorageService.get('specialArtist'));
// Remove binding. Clears $watch on scopeKey:
lsUnbind();
```
Check out the full demo and documentation at http://gregpike.net/demos/angular-local-storage/demo.html