Manual bootstrap and local storage

Hi everyone,

I have a published app that is auto bootstrapped with the ng-app directive like so:


I have now added a Cordova plugin that I would like to use on the first page. In order to avoid a race condition between the plugin being ready and the first state, I’ve switched to manually bootstrapping Angular like so (credit to Rogmar in this thread):

window.ionic.Platform.ready(function() {
angular.bootstrap(document.body, [‘myApp’]);

My issue is that when I manually bootstrap Angular, all of my local storage disappears like a fresh install or a different site. If I switch back to the ng-app directive, all previous local storage re-appears like normal.

I’d hate to destroy my users’ data with this next upgrade. Can anyone explain to me why the manual bootstrap is treated like a new install and how to avoid it?