diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-21 12:49:18 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-21 12:49:18 -0400 |
| commit | b28028ac4082842143b0f528d6bc539da6ccb419 (patch) | |
| tree | 1e26ea969a781ed8e323fca4e3c76345113fc694 /www/js/ionicUtils.js | |
| parent | 676270d21beed31d767a06c89522198c77d5d865 (diff) | |
mega changes, including updates and X
Diffstat (limited to 'www/js/ionicUtils.js')
| -rw-r--r-- | www/js/ionicUtils.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/www/js/ionicUtils.js b/www/js/ionicUtils.js new file mode 100644 index 00000000..c593624c --- /dev/null +++ b/www/js/ionicUtils.js @@ -0,0 +1,32 @@ +/* jshint -W041 */ +/* jshint browser: true*/ +/* global cordova,StatusBar,angular,console */ + +//http://learn.ionicframework.com/formulas/localstorage/ + +angular.module('ionic.utils', []) + +.factory('$localstorage', ['$window', function($window) +{ + return { + + init: function() {}, + + set: function(key, value) + { + $window.localStorage[key] = value; + }, + get: function(key, defaultValue) + { + return $window.localStorage[key] || defaultValue; + }, + setObject: function(key, value) + { + $window.localStorage[key] = JSON.stringify(value); + }, + getObject: function(key) + { + return JSON.parse($window.localStorage[key] || '{}'); + } + }; +}]); |
