dist
angular-storage.js +12 -7
angular-storage.min.js +1 -1
src/angularStorage/services
storage.js +2 -2
package.json +8 -8
+ 12
- 7
@@ -25,7 +25,7 @@ angular.module('angular-storage.internalStore', ['angular-storage.storage'])
@@ -35,19 +35,24 @@ angular.module('angular-storage.internalStore', ['angular-storage.storage'])
@@ -56,10 +61,10 @@ angular.module('angular-storage.internalStore', ['angular-storage.storage'])
@@ -70,7 +75,7 @@ angular.module('angular-storage.storage', [])
+ 1
- 1
!function(){angular.module("angular-storage",["angular-storage.store"]),angular.module("angular-storage.internalStore",["angular-storage.storage"]).factory("InternalStore",["storage",function(e){function t(e,t){this.namespace=e||null,this.delimiter=t||".",this.inMemoryCache={}}return t.prototype.getNamespacedKey=function(e){return this.namespace?[this.namespace,e].join(this.delimiter):e},t.prototype.set=function(t,r){this.inMemoryCache[t]=r,e.set(this.getNamespacedKey(t),JSON.stringify(r))},t.prototype.get=function(t){if(t in this.inMemoryCache)return this.inMemoryCache[t];var r=e.get(this.getNamespacedKey(t)),n=r?JSON.parse(r):null;return this.inMemoryCache[t]=n,n},t.prototype.remove=function(t){this.inMemoryCache[t]=null,e.remove(this.getNamespacedKey(t))},t}]),angular.module("angular-storage.storage",[]).service("storage",["$window",function(e){if(e.localStorage)this.set=function(t,r){return e.localStorage.setItem(t,r)},this.get=function(t){return e.localStorage.getItem(t)},this.remove=function(t){return e.localStorage.removeItem(t)};else{var t=$injector.get("$cookieStore");this.set=function(e,r){return t.put(e,r)},this.get=function(e){return t.get(e)},this.remove=function(e){return t.remove(e)}}}]),angular.module("angular-storage.store",["angular-storage.internalStore"]).factory("store",["InternalStore",function(e){var t=new e;return t.getNamespacedStore=function(t,r){return new e(t,r)},t}])}();
\ No newline at end of file
!function(){angular.module("angular-storage",["angular-storage.store"]),angular.module("angular-storage.internalStore",["angular-storage.storage"]).factory("InternalStore",["storage",function(e){function t(e,t){this.namespace=e||null,this.delimiter=t||".",this.inMemoryCache={}}return t.prototype.getNamespacedKey=function(e){return this.namespace?[this.namespace,e].join(this.delimiter):e},t.prototype.set=function(t,r){this.inMemoryCache[t]=r,e.set(this.getNamespacedKey(t),JSON.stringify(r))},t.prototype.get=function(t){var r=null;if(t in this.inMemoryCache)return this.inMemoryCache[t];var n=e.get(this.getNamespacedKey(t));try{r=n?JSON.parse(n):null,this.inMemoryCache[t]=r}catch(o){this.remove(t)}return r},t.prototype.remove=function(t){this.inMemoryCache[t]=null,e.remove(this.getNamespacedKey(t))},t}]),angular.module("angular-storage.storage",[]).service("storage",["$window","$injector",function(e,t){if(e.localStorage)this.set=function(t,r){return t&&r?e.localStorage.setItem(t,r):null},this.get=function(t){return e.localStorage.getItem(t)},this.remove=function(t){return e.localStorage.removeItem(t)};else{var r=t.get("$cookieStore");this.set=function(e,t){return e&&t?r.put(e,t):null},this.get=function(e){return r.get(e)},this.remove=function(e){return r.remove(e)}}}]),angular.module("angular-storage.store",["angular-storage.internalStore"]).factory("store",["InternalStore",function(e){var t=new e;return t.getNamespacedStore=function(t,r){return new e(t,r)},t}])}();
\ No newline at end of file
@@ -2,7 +2,7 @@ angular.module('angular-storage.storage', [])
@@ -13,7 +13,7 @@ angular.module('angular-storage.storage', [])
+ 8
- 8
@@ -7,24 +7,24 @@
"chai-jquery": "^1.2.3",
"gulp-concat": "^2.3.4",
"gulp-ng-annotate": "^0.3.3",
"gulp-uglify": "^0.3.1",
"karma-chrome-launcher": "^0.1.4",
"karma-mocha": "^0.1.8",