I have Cordova and Ionic based mobile application. On the default page which is loaded after the start of the application is need to work with SQLLite plugin.
https
I couldn't make it work with the @t4deu solution, because my ng-app tag was in the body, so I leave a little change in case that it helps to someone.
<script>
document.addEventListener('deviceready', function() {
angular.bootstrap(document.querySelector('body'), ['starter']);
}, false);
</script>
You need to invert this, first you handle the cordova "deviceready" event and then you start the angularjs app. Like this:
First remove the the ng-app attribute from the html/body tag
Start the angular app after the devireready:
<script>
document.addEventListener('deviceready', function() {
angular.bootstrap(document, ['YourAppName']);
}, false);
var YourAppName = angular.module('YourAppName', []);
</script>
Similar questions: