$ionicPlatform.ready, IonicView issue


Well, I’m facing a very strange issue I hope someone can help me out there.
I have an ionic project, which I usually show it to my clients using the Ionic View.
The application starts with a default view that checks if the user is logged in or not to move him to the proper view.
Unfortunately the code is not running on the ionic view anymore, I have tried to find the problem, but it seems that each time I call ($ionicPlatform.ready(…)) the application fails. Does any one face that same issue ?
This is the code I used in my controller:

MyApp.controller(‘DefaultCtrl’, function ($state, $ionicHistory, $ionicPlatform,$q, Util) {
$ionicPlatform.ready(function () {
var loadingPopup = Util.showToast(“Loading system settings … please wait”, ‘bottom’, ‘short’);
var promises = [];
//… wait for all promise to resolve…
var location = Util.GetSelectedLocation();
if (location != null) {
$state.go(“Brand”, {area_id: location[1].areaID});
else if (Util.IsLoggedIn()) {
else {

  disableBack: true