mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(lifecycle): disconnect leaving scope after transition
Closes #2818
This commit is contained in:
4
js/angular/controller/navViewController.js
vendored
4
js/angular/controller/navViewController.js
vendored
@@ -164,9 +164,13 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
|
||||
if (viewElement.data(DATA_DESTROY_ELE) || viewElement.data(DATA_NO_CACHE)) {
|
||||
// this element shouldn't stay cached
|
||||
$ionicViewSwitcher.destroyViewEle(viewElement);
|
||||
|
||||
} else {
|
||||
// keep in the DOM, mark as cached
|
||||
navViewAttr(viewElement, VIEW_STATUS_CACHED);
|
||||
|
||||
// disconnect the leaving scope
|
||||
ionic.Utils.disconnectScope(viewElement.scope());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user