Updated documentation

revert-117-master
Gregory Pike 11 years ago
parent ee9c6d3f6f
commit 5d3d56b43b

@ -5,13 +5,14 @@ var angularLocalStorage = angular.module('LocalStorageModule', []);
angularLocalStorage.provider('localStorageService', function(){ angularLocalStorage.provider('localStorageService', function(){
// You should set a prefix to avoid overwriting any local storage variables from the rest of your app // You should set a prefix to avoid overwriting any local storage variables from the rest of your app
// e.g. angularLocalStorage.constant('prefix', 'youAppName'); // e.g. localStorageServiceProvider.setPrefix('youAppName');
// With provider you can use config as this: // With provider you can use config as this:
// myApp.config(function (localStorageServiceProvider) { // myApp.config(function (localStorageServiceProvider) {
// localStorageServiceProvider.prefix = 'yourAppName'; // localStorageServiceProvider.prefix = 'yourAppName';
// }); // });
this.prefix = 'ls'; this.prefix = 'ls';
// Cookie options (usually in case of fallback) // Cookie options (usually in case of fallback)
// expiry = Number of days before cookies expire // 0 = Does not expire // expiry = Number of days before cookies expire // 0 = Does not expire
// path = The web path the cookie represents // path = The web path the cookie represents
@ -19,19 +20,28 @@ angularLocalStorage.provider('localStorageService', function(){
expiry: 30, expiry: 30,
path: '/' path: '/'
}; };
// Send signals for each of the following actions?
this.notify = { this.notify = {
setItem: true, setItem: true,
removeItem: false removeItem: false
}; };
// Setter for the prefix
this.setPrefix = function(prefix){ this.setPrefix = function(prefix){
this.prefix = prefix; this.prefix = prefix;
}; };
// Setter for cookie config
this.setStorageCookie = function(exp, path){ this.setStorageCookie = function(exp, path){
this.cookie = { this.cookie = {
expiry: exp, expiry: exp,
path: path path: path
}; };
}; };
// Setter for notification config
// itemSet & itemRemove should be booleans
this.setNotify = function(itemSet, itemRemove){ this.setNotify = function(itemSet, itemRemove){
this.notify = { this.notify = {
setItem: itemSet, setItem: itemSet,