Created
January 25, 2017 15:54
-
-
Save wwwmarcos/aace5d7602d5b2b7a9a346a48087463a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict' | |
angular | |
.module('LocalStorageServices', []) | |
.factory('LocalStorageService', LocalStorageService) | |
LocalStorageService.$inject = ['$cookies'] | |
function LocalStorageService($cookies) { | |
var factory = { | |
put: put, | |
get: get, | |
remove: remove, | |
getAll: getAll | |
} | |
return factory | |
function put(key, value, options) { | |
return $cookies.put(key, value, options) | |
} | |
function get(key) { | |
return $cookies.get(key) | |
} | |
function remove(key, options) { | |
return $cookies.remove(key, options) | |
} | |
function getAll(){ | |
return $cookies.getAll() | |
} | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment