Skip to content

Instantly share code, notes, and snippets.

View temitope's full-sized avatar

Temitope temitope

View GitHub Profile
@Alexintosh
Alexintosh / $localstorage
Created March 18, 2015 11:59
Angular factory for local storage
.factory('$localstorage', ['$window', function($window) {
return {
set: function(key, value) {
$window.localStorage[key] = value;
},
get: function(key, defaultValue) {
return $window.localStorage[key] || false;
},
setObject: function(key, value) {
$window.localStorage[key] = JSON.stringify(value);