01 febrero 2015

Ionic Framework: Don't reload controller on state change




This is due to the new Ionic Framework's Caching system:
By default, views are cached to improve performance. When a view is navigated away from, its element is left in the DOM, and its scope is disconnected from the $watch cycle. When navigating to a view that is already cached, its scope is then reconnected, and the existing element that was left in the DOM becomes the active view. This also allows for the scroll position of previous views to be maintained.

Solution 1: http://ionicframework.com/docs/api/directive/ionNavView/

Solution 2: https://github.com/angular-ui/ui-router/issues/582#issuecomment-68781282