From 5d3d56b43bd6dea11694638d2c4ec2569eca33ce Mon Sep 17 00:00:00 2001 From: Gregory Pike Date: Thu, 26 Dec 2013 22:48:07 -0500 Subject: [PATCH] Updated documentation --- angular-local-storage.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/angular-local-storage.js b/angular-local-storage.js index 15a31c8..ca92606 100644 --- a/angular-local-storage.js +++ b/angular-local-storage.js @@ -5,13 +5,14 @@ var angularLocalStorage = angular.module('LocalStorageModule', []); angularLocalStorage.provider('localStorageService', function(){ // 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: // myApp.config(function (localStorageServiceProvider) { // localStorageServiceProvider.prefix = 'yourAppName'; // }); - this.prefix = 'ls'; + this.prefix = 'ls'; + // Cookie options (usually in case of fallback) // expiry = Number of days before cookies expire // 0 = Does not expire // path = The web path the cookie represents @@ -19,19 +20,28 @@ angularLocalStorage.provider('localStorageService', function(){ expiry: 30, path: '/' }; + + // Send signals for each of the following actions? this.notify = { setItem: true, removeItem: false }; + + // Setter for the prefix this.setPrefix = function(prefix){ this.prefix = prefix; }; + + // Setter for cookie config this.setStorageCookie = function(exp, path){ this.cookie = { expiry: exp, path: path }; }; + + // Setter for notification config + // itemSet & itemRemove should be booleans this.setNotify = function(itemSet, itemRemove){ this.notify = { setItem: itemSet,