I’ve been experiencing a strange behavior on a side menu-like app with ionic 1.0.0-beta13.
The problem is basically that the
ion-nav-back-button on the header of the menu is shown after navigating, even if I use
nav-clear on all the menu options. I found that it’s related to the use of a
$stateChangeStart listener on
You can reproduce this behavior in the following codepen: http://codepen.io/anon/pen/azdGzo?editors=101 by just navigating like this: “Check-in” -> “Attendees” -> “Home” -> “Check-in”.
You’ll see that after the last navigation the arrow back appears on the left of the menu button. Nevertheless it doesn’t happen if you comment out the
$rootScope.$on($stateChangeStart... (lines 45-49).
Is this a bug?
To achieve the same result (setting a scope property to false as soon as a specific state is left), now I’m using
$scope.$on("$destroy"..., but I’m not sure if the
$destroy event is guaranteed to arrive when the user leaves the screen. Is there a better way of implementing this?.
Thanks in advance.