This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
angular-local-storage/README.md

34 lines
894 B
Markdown
Raw Normal View History

2012-08-27 06:31:44 +00:00
angular-local-storage
=====================
2012-08-27 07:16:47 +00:00
An Angular module that gives you access to the browsers local storage
Example use:
2012-09-14 06:51:21 +00:00
```javascript
angular.module('yourModule', ['LocalStorageModule'])
.controller('yourCtrl', [
'$scope',
'localStorageService',
function($scope, localStorageService) {
// Start fresh
localStorageService.clearAll();
2013-01-23 17:31:02 +00:00
localStorageService.add('Favorite Sport','Ultimate Frisbee');
2012-09-14 06:51:21 +00:00
}]);
2013-12-27 03:51:47 +00:00
/*
2013-12-27 03:52:45 +00:00
To set the prefix of your localStorage name, you can use the setPrefix method
available on the localStorageServiceProvider
2013-12-27 03:51:47 +00:00
*/
angular.module('yourModule', ['LocalStorageModule'])
.config(['localStorageServiceProvider', function(localStorageServiceProvider){
localStorageServiceProvider.setPrefix('newPrefix');
});
2012-09-14 06:51:21 +00:00
```
2013-09-25 03:11:05 +00:00
Check out the full demo and documentation at http://gregpike.net/demos/angular-local-storage/demo.html
2013-12-27 04:14:15 +00:00
To do:
- Add tests
- Expand Readme