refactor(lifecycle): disconnect leaving scope after transition

Closes #2818
This commit is contained in:
Adam Bradley
2015-02-11 08:37:23 -06:00
parent 3628ebac16
commit 04a0cce134
3 changed files with 38 additions and 3 deletions

View File

@@ -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());
}
}
}