passman/js/app/services/cacheservice.js
2016-10-07 19:56:29 +02:00

22 lines
No EOL
555 B
JavaScript

(function () {
'use strict';
/**
* @ngdoc service
* @name passmanApp.CacheService
* @description
* # CacheService
* Service in the passmanApp.
*/
angular.module('passmanApp')
.service('CacheService', ['localStorageService', 'EncryptService', function (localStorageService, EncryptService) {
return {
get: function(name){
return EncryptService.decryptString(localStorageService.get(name));
},
set: function (key, value) {
value = EncryptService.encryptString(value);
localStorageService.set(key, value);
}
};
}]);
}());