angular-storage
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "a0-angular-storage", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ { |
@@ -13,3 +13,3 @@ (function() { | ||
angular.module('angular-storage.store', ['angular-storage.storage']) | ||
angular.module('angular-storage.internalStore', ['angular-storage.storage']) | ||
.factory('InternalStore', ["storage", function(storage) { | ||
@@ -86,7 +86,7 @@ | ||
angular.module('angular-storage.store', ['angular-storage.storage']) | ||
.factory('store', ["storage", "InternalStore", function(storage, InternalStore) { | ||
angular.module('angular-storage.store', ['angular-storage.internalStore']) | ||
.factory('store', ["InternalStore", function(InternalStore) { | ||
var store = new InternalStore(); | ||
store.getStoreFor = function(namespace, key) { | ||
store.getNamespacedStore = function(namespace, key) { | ||
return new InternalStore(namespace, key); | ||
@@ -93,0 +93,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(){angular.module("angular-storage",["angular-storage.store"]),angular.module("angular-storage.store",["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.storage"]).factory("store",["storage","InternalStore",function(e,t){var r=new t;return r.getStoreFor=function(e,r){return new t(e,r)},r}])}(); | ||
!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}])}(); |
0.0.6 / 2014-10-08 | ||
================== | ||
* Added dist files I forgot | ||
0.0.5 / 2014-10-08 | ||
@@ -3,0 +8,0 @@ ================== |
{ | ||
"name": "angular-storage", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Martin Gontovnikas", |
26128