Hello people,
Sorry for by bad english, i’m a french developer
(www.tibz.net)
i’m currently making an IOS mobile application with Ionic and i’ve got a little problem with first initialization.
I work with the sidemenu template from the beginning, my first controller is init from the
$urlRouterProvider.otherwise('/app/mycontroller');
In my first controller (my main rub), i need use $cordovaNetwork and other cordova plugin (ng-cordova is great guy!), to do this, i must wait a $ionicPlatform.ready response.
I already listen this event on app.js in the run method.
angular.module('vttapp', ['ionic','ngCordova','vttapp.controllers', 'vttapp.services','vttapp.utils'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function(){
// todo
});
}).config..........
I want wait this event and only after initialise my first controller, i wan’t use the
$urlRouterProvider.otherwise('/app/mycontroller')
who initialise my controller before event is dispatched.
It’s possible it’s a tips about Angular (i’m newbie with), Thanks for your answers anyway!
I could wait a $ionicPlatform.ready directly from my first controller, but i want really do intialisation outside of my controller ($ionicPlatform.ready dispatch only one time)
Thanks !