fix(NavController): fire onPageWillUnload/DidUnload

Fixes #5507
This commit is contained in:
Adam Bradley
2016-02-18 11:05:45 -06:00
parent 7e3eb23345
commit 8f0b88b7e4
3 changed files with 45 additions and 21 deletions

View File

@ -802,6 +802,7 @@ export class NavController extends Ion {
// set that it is the init leaving view
// the first view to be removed, it should init leave
view.state = STATE_INIT_LEAVE;
view.willUnload();
// from the index of the leaving view, go backwards and
// find the first view that is inactive so it can be the entering
@ -836,7 +837,6 @@ export class NavController extends Ion {
this._views.filter(v => v.state === STATE_REMOVE).forEach(view => {
view.willLeave();
view.didLeave();
view.didUnload();
this._views.splice(this.indexOf(view), 1);
view.destroy();
});