• Home

Another good example for $ionicPlatform.ready usage

I was working with geolocation on iOS/Android with Ionic+Cordova+AngularJS stack and once again I came accross a really good example of $ionicPlatform.ready usage.

For the moment I will just give you a gist of my controller file, but I wil soon release a sample git repo for you to try.

In a few words if you bind some fields in a view, refreshed with the help of a button and if you do not use the $ionicPlatform.ready function you will have to click twice. The first time the plugin will load, the next time it will fire. Raymond Camden did a good job explaining this race condition there (even my solution is controller located the explanation is fully relevant).

Print Email