$state.go() is not working on IOS devices


#1

Hi everyone.

I have an issue on iPhone devices , where state transitions are not working.

the code looks likes this, which is called on button click.

$state.go('app.addLines', {
         id: $scope.company.id,
        date: $scope.dateSelected
    });

and the config is:

$stateProvider.state('app.addLines', {
    cache: false,
    url: "/addLines/:id/:date",
    views: {
      'menuContent': {
        templateUrl: "templates/addlines.html",
        controller: 'AddlinesCtrl'
      }
    }
  })

I tried the suggestions on here, but no luck for now: Using $state.go to navigate between views doesn't work, $location.path does

Any idea what’s the issue?


#2

It happened to me when I forgot to create the controller. Are you sure that you have the AddlinesCtrl controller ?


#3

Are your devices running iOS9?
Is your app running fine on Android?


#4

@gmarziou it’s IOS 9 , and the app is working fine on Android.


#5

Yes @gensollen, AddlinesCtrl is defined, and the app is working correctly on Android.


#6

iOS 9 has introduced regressions, an angular patch is required unless you use angular 1.4.6 or later which has included the patch.
So upgrade Angular to 1.4.7 in your bower.json.


#7

@gmarziou Do you think my below issue is also related to angular version ?

Screens are overlapping on iPhone 6s. Also this happens once an while.
App is working fine on android.


#8

Yes this is one of ios9 issues. Do you put the patch ?


#9

where can I find the angular 1.4.6 or later? sorry if it is sound like a stupid question, I am new to this. I am still familiar myself around.


#10

In your bower.json file, you should have something like below, then run bower install.
There’s probably a way to do it with ionic cli tool but I don’t use it often.

  "dependencies": {
    "ionic": "1.1.0",
    "angular": "1.4.7",
...
  },
...
  "resolutions": {
    "angular": "1.4.7",
  }
}

#11

This Worked Like a Charm for me