ionicPlatform.ready

I’m trying to figure out how to use this with the new version. 0.9.22

I’ve tried adding $ionicPlatform in my controller. I’ve also tried ionic.Platform.ready() in the controller and nothing is firing.

I’m testing in google chrome, but even when i test with phoneGap app it doesn’t fire.

I was wondering if someone has a plunker or example how to use this.

Thanks,

Hey @vialware, did you make sure to include org.apache.cordova.device in your cordova plugins?

Then, using this is as simple as:

controller('MyCtrl', function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // called when ready
  });
}); 

Let me know if that works for you!

Yes I had it included. I use phonegap build and I think the issue was on their end

I found this issue today. It working on Grunt server, but not in cordova server

I had a similar issue yesterday as well. I went back to using the old way with a javascript running a function on deviceready like phonegap/cordova shows.

For me the issue was the StatusBar plugin wasn’t doing what I wanted. As soon as i moved by code back to the original way things are working again.