Skip to content

Commit 64d5bed

Browse files
committedAug 14, 2014
Merge pull request #118 from a8m/master
fix CI build falling, and broken tests
2 parents b29b896 + 642f1fe commit 64d5bed

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed
 

‎angular-local-storage.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var angularLocalStorage = angular.module('LocalStorageModule', []);
55

66
angularLocalStorage.provider('localStorageService', function() {
7-
7+
88
// You should set a prefix to avoid overwriting any local storage variables from the rest of your app
99
// e.g. localStorageServiceProvider.setPrefix('youAppName');
1010
// With provider you can use config as this:
@@ -65,11 +65,11 @@ angularLocalStorage.provider('localStorageService', function() {
6565

6666

6767
this.$get = ['$rootScope', '$window', '$document', function($rootScope, $window, $document) {
68-
69-
var prefix = this.prefix;
70-
var cookie = this.cookie;
71-
var notify = this.notify;
72-
var storageType = this.storageType;
68+
var self = this;
69+
var prefix = self.prefix;
70+
var cookie = self.cookie;
71+
var notify = self.notify;
72+
var storageType = self.storageType;
7373
var webStorage;
7474

7575
// When Angular's $document is not available
@@ -110,7 +110,7 @@ angularLocalStorage.provider('localStorageService', function() {
110110
return false;
111111
}
112112
}());
113-
113+
114114

115115

116116
// Directly adds a value to local storage
@@ -119,7 +119,7 @@ angularLocalStorage.provider('localStorageService', function() {
119119
var addToLocalStorage = function (key, value) {
120120

121121
// If this browser does not support local storage use cookies
122-
if (!browserSupportsLocalStorage || this.storageType === 'cookie') {
122+
if (!browserSupportsLocalStorage || self.storageType === 'cookie') {
123123
$rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');
124124
if (notify.setItem) {
125125
$rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'cookie'});
@@ -138,7 +138,7 @@ angularLocalStorage.provider('localStorageService', function() {
138138
}
139139
if (webStorage) {webStorage.setItem(deriveQualifiedKey(key), value)};
140140
if (notify.setItem) {
141-
$rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: this.storageType});
141+
$rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: self.storageType});
142142
}
143143
} catch (e) {
144144
$rootScope.$broadcast('LocalStorageModule.notification.error', e.message);
@@ -151,7 +151,7 @@ angularLocalStorage.provider('localStorageService', function() {
151151
// Example use: localStorageService.get('library'); // returns 'angular'
152152
var getFromLocalStorage = function (key) {
153153

154-
if (!browserSupportsLocalStorage || this.storageType === 'cookie') {
154+
if (!browserSupportsLocalStorage || self.storageType === 'cookie') {
155155
$rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
156156
return getFromCookies(key);
157157
}
@@ -184,7 +184,7 @@ angularLocalStorage.provider('localStorageService', function() {
184184
try {
185185
webStorage.removeItem(deriveQualifiedKey(key));
186186
if (notify.removeItem) {
187-
$rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: this.storageType});
187+
$rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: self.storageType});
188188
}
189189
} catch (e) {
190190
$rootScope.$broadcast('LocalStorageModule.notification.error', e.message);
@@ -335,7 +335,7 @@ angularLocalStorage.provider('localStorageService', function() {
335335
var cookies = $document.cookie.split(';');
336336
for(var i = 0; i < cookies.length; i++) {
337337
thisCookie = cookies[i];
338-
338+
339339
while (thisCookie.charAt(0) === ' ') {
340340
thisCookie = thisCookie.substring(1, thisCookie.length);
341341
}

‎angular-local-storage.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-local-storage",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"homepage": "http://gregpike.net/demos/angular-local-storage/demo.html",
55
"authors": [
66
"grevory <greg@gregpike.ca>"

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-local-storage",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "An Angular module that gives you access to the browsers local storage",
55
"main": "angular-local-storage.js",
66
"scripts": {

0 commit comments

Comments
 (0)
Please sign in to comment.