From b77b2ae440886746e35985768d3b4785eab62ee7 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 15 Nov 2016 10:42:03 +0100 Subject: [PATCH] fix(nav): willLeave is called before willEnter fixes #9163 --- src/navigation/nav-controller-base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index a23bd629935..011ceba9d43 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -656,9 +656,9 @@ export class NavControllerBase extends Ion implements NavController { _viewsWillLifecycles(enteringView: ViewController, leavingView: ViewController) { if (enteringView || leavingView) { this._zone.run(() => { - // call each view's lifecycle events - enteringView && this._willEnter(enteringView); + // Here, the order is important. WillLeave must called before WillEnter. leavingView && this._willLeave(leavingView); + enteringView && this._willEnter(enteringView); }); } }