I’m wondering if something is wrong here. The stateChangeSuccess
event is operating a bit differently in the nightlies with view caching than in Beta 13.
Controllers that use $scope.$on('$stateChangeSuccess
)` are reporting that event even when they are not the active view.
See this Beta 13 sample below, open the console, and navigate between the views in the sidebar. Each controller reports the stateChangeSuccess event only when state is changed to that controller.
Link : http://codepen.io/calendee/pen/emmoNZ
Now, open this nightly sample below. Do the same thing. Notice that the current and previous controller is reporting that $stateChangeSuccess
event.
Link : http://codepen.io/calendee/pen/VYYNYy
Is this a bug or just part of the whole cache system where controllers stay in memory but are removed from scope? I know there are some new $ionicView
events that can be used to know when a view is entered, left, etc. However, I’m wondering if there is actually a problem with $stateChangeSuccess
firing twice or getting listened to forever.