Wallet/js/services/storage.js
2014-04-01 18:22:07 -03:00

22 lines
468 B
JavaScript

'use strict';
angular.module('copay.storage')
.factory('Storage', function($rootScope) {
return {
get: function(key) {
return JSON.parse(localStorage.getItem(key));
},
save: function(key, data) {
localStorage.setItem(key, JSON.stringify(data));
},
remove: function(key) {
localStorage.removeItem(key);
},
clearAll: function() {
localStorage.clear();
}
};
});