Skip to content

Commit

Permalink
Add serialization to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
egilkh committed Aug 19, 2015
1 parent 1ea74bc commit 61cb004
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,28 @@ var app = angular.module('app', ['ngStorage'])
}])
```
### Custom serialization
To change how ngStorage serializes and deserializes values (uses JSON by default) you can use your own functions.
```javascript
angular.module('app', ['ngStorage'])
.config(['$localStorageProvider',
function ($localStorageProvider) {
var mySerializer = function (value) {
// Do what you want with the value.
return value;
};
var myDeserializer = function (value) {
return value;
};
$localStorageProvider.setSerializer(mySerializer);
$localStorageProvider.setDeserializer(myDeserializer);
}];)
```
### Minification
Just run `$ npm install` to install dependencies. Then run `$ grunt` for minification.
Expand Down

0 comments on commit 61cb004

Please sign in to comment.