How to use ionic cordova preferences? -


currently i'm using cordova app preferences store data today's date key.

var pref = $cordovapreferences.fetch(date, 'dates').$$state.status; if (pref===0) {       var out = $cordovapreferences.store(date, '1', 'dates');       dbpopup('store' + json.stringify(out)); 

}

but both fetch , store methods displays status 0. didn't uninstall app every time. since uninstallation of app removes stored preferences..

i recommend using $window.localstorage. uses keys save strings. can use json.stringify convert objects string.

an example can found here: http://codepen.io/drewrygh/pen/ciozb


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -