Skip to content

Commit 2c57fdf

Browse files
committed
Merge pull request #103 from darrylhebbes/patch-1
Update README.md
2 parents d08649f + 12c8104 commit 2c57fdf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ angular.module('yourModule', ['LocalStorageModule'])
2727
localStorageServiceProvider.setPrefix('newPrefix');
2828
}]);
2929
```
30+
31+
#### How to bind to a $scope variable:
32+
Usage: localStorageService.bind(scope, key, def);
33+
```
34+
// Example
35+
$scope.anArtist = {'firstname':'Pablo', 'lastname':'Picasso'};
36+
37+
// Bind to local storage service
38+
localStorageService.bind($scope, 'anArtist', anArtist);
39+
40+
// get bound data:
41+
console.log(localStorageService.get('anArtist'));
42+
```
43+
3044
Check out the full demo and documentation at http://gregpike.net/demos/angular-local-storage/demo.html
3145

3246
To do:

0 commit comments

Comments
 (0)