Last active
October 20, 2016 10:33
-
-
Save maxca/ef9e2042673e37fb74f061f3b00f0d52 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** service local storage */ | |
| (function() { | |
| var serviceLocalStorage = angular.module('serviceLocalStorage', []); | |
| serviceLocalStorage.service('localStorage', function() { | |
| this.set = function(key, value) { | |
| return localStorage.setItem(key, value); | |
| }; | |
| this.get = function(key) { | |
| return localStorage.getItem(key); | |
| }; | |
| this.del = function(key) { | |
| return localStorage.removeItem(key); | |
| } | |
| this.cls = function() { | |
| return localStorage.clear(); | |
| } | |
| }); | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment