Skip to content

Instantly share code, notes, and snippets.

@wwwmarcos
Created January 25, 2017 15:54
Show Gist options
  • Save wwwmarcos/aace5d7602d5b2b7a9a346a48087463a to your computer and use it in GitHub Desktop.
Save wwwmarcos/aace5d7602d5b2b7a9a346a48087463a to your computer and use it in GitHub Desktop.
(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