localStorage not working

Hi,

I need some help with an issue I’m having.

Environment:
I’m using the Ionic framework with eclipse jboss 64bit version. I debug my android cordova application using CorodvaSim.

Issue
I have tried this tutorial’s AngularJS service section. When I try to implement something like the code sample below I get an error in the console.

$ionicPlatform.ready().then(function() {
       $localstorage.set('key1', 'test');
});

Console
!JavaScript ERROR: Error: ‘null’ is not an object (evaluating ‘$window.localStorage[key]’)

Any help will be appreciated.

Thanks

You can try ngStorage: https://github.com/gsklee/ngStorage simple and clean.

Or you can use localForage provide by Mozilla http://mozilla.github.io/localForage/

ngModule associate: https://github.com/ocombe/angular-localForage