angular-storage
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "a0-angular-storage", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ { |
@@ -51,7 +51,9 @@ (function() { | ||
this.get = function(name) { | ||
if (this.inMemoryCache[name]) { | ||
if (name in this.inMemoryCache) { | ||
return this.inMemoryCache[name]; | ||
} | ||
var saved = storage.get(name); | ||
return saved ? JSON.parse(saved) : null; | ||
var obj = saved ? JSON.parse(saved) : null; | ||
this.inMemoryCache[name] = obj; | ||
return obj; | ||
}; | ||
@@ -58,0 +60,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(){angular.module("angular-storage",["angular-storage.store"]),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.storage"]).service("store",["storage",function(e){this.inMemoryCache={},this.set=function(t,r){this.inMemoryCache[t]=r,e.set(t,JSON.stringify(r))},this.get=function(t){if(this.inMemoryCache[t])return this.inMemoryCache[t];var r=e.get(t);return r?JSON.parse(r):null},this.remove=function(t){this.inMemoryCache[t]=null,e.remove(t)}}])}(); | ||
!function(){angular.module("angular-storage",["angular-storage.store"]),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.storage"]).service("store",["storage",function(e){this.inMemoryCache={},this.set=function(t,r){this.inMemoryCache[t]=r,e.set(t,JSON.stringify(r))},this.get=function(t){if(t in this.inMemoryCache)return this.inMemoryCache[t];var r=e.get(t),n=r?JSON.parse(r):null;return this.inMemoryCache[t]=n,n},this.remove=function(t){this.inMemoryCache[t]=null,e.remove(t)}}])}(); |
0.0.4 / 2014-10-07 | ||
================== | ||
* New dist files | ||
0.0.3 / 2014-10-07 | ||
@@ -3,0 +8,0 @@ ================== |
{ | ||
"name": "angular-storage", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Martin Gontovnikas", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21136
448