From d22d77b48546de79e47b5dde2df1a9dac24c2e5c Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Wed, 5 Jul 2017 23:45:38 -0500 Subject: [PATCH] fix(navigation): restore getActiveChildNav method to maintain old API, add deprecation notice --- src/navigation/nav-controller-base.ts | 8 ++++++++ src/navigation/nav-controller.ts | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index 8a8be94b79..9da552d677 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -1191,6 +1191,14 @@ export class NavControllerBase extends Ion implements NavController { getSecondaryIdentifier(): string { return null; } + + /** + * Returns the active child navigation. + */ + getActiveChildNav(): any { + console.warn('(getActiveChildNav) is deprecated and will be removed in the next major release. Use getActiveChildNavs instead.'); + return this._children[this._children.length - 1]; + } } let ctrlIds = -1; diff --git a/src/navigation/nav-controller.ts b/src/navigation/nav-controller.ts index b6db46d7f1..0f02e0f0eb 100644 --- a/src/navigation/nav-controller.ts +++ b/src/navigation/nav-controller.ts @@ -590,10 +590,16 @@ export abstract class NavController implements NavigationContainer { abstract getViews(): Array; /** - * Returns the active child navigation. + * Returns a list of the active child navigation. */ abstract getActiveChildNavs(): any[]; + /** + * Returns the active child navigation. + */ + abstract getActiveChildNav(): any; + + /** * Returns if the nav controller is actively transitioning or not. * @return {boolean}