I'm in the process of switching an existing AngularJS mobile app from Trigger.io to Cordova, as it provides way better/more plugins for what I'm building.
Cordova requires my application to be loaded after the deviceready
event is fired. My application is built on top of the ionic framework, and they provide a wrapper (window.ionic.Platform.ready
) for this event. I thought it was going to be as simple as removing ng-app
from my HTML and bootstrap my app when the device is ready. Alas...
I came across something weird. I'm using ui-router to handle my states and they get triggered in the $stateChangeStart
, but the controller linked to that state does not get triggered at all.
I've made two Plunkrs as example;
- the first one uses
ng-app
and works perfectly - the second one uses
angular.bootstrap
, but neverconsole.log
s stuff from my controllers.
Am I doing something wrong here? Any help is appreciated!