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

36 lines
1.0 KiB
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
2014-02-14 07:44:45 +00:00
[![Build Status](https://secure.travis-ci.org/grevory/angular-local-storage.png?branch=master)](https://travis-ci.org/grevory/)
2014-02-14 07:40:21 +00:00
2012-08-27 07:16:47 +00:00
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();
localStorageService.set('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