diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index 5c0967e7834..28f28676a5a 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -237,7 +237,7 @@ export class NavControllerBase extends Ion implements NavController { this._queue.push(ti); - // if there isn't a transitoin already happening + // if there isn't a transition already happening // then this will kick off this transition this._nextTrns(); @@ -287,8 +287,8 @@ export class NavControllerBase extends Ion implements NavController { leavingRequiresTransition = (ti.removeStart + ti.removeCount === viewsLength); - for (var i = ti.removeStart; i <= ti.removeCount; i++) { - destroyQueue.push(this._views[i]); + for (var i = 0; i < ti.removeCount; i++) { + destroyQueue.push(this._views[i + ti.removeStart]); } for (var i = viewsLength - 1; i >= 0; i--) { @@ -914,6 +914,13 @@ export class NavControllerBase extends Ion implements NavController { return this._views.length; } + /** + * Return the stack of views in this NavController. + */ + getViews(): Array { + return this._views; + } + isSwipeBackEnabled(): boolean { return this._sbEnabled; } diff --git a/src/navigation/nav-controller.ts b/src/navigation/nav-controller.ts index 08fb80a111f..7711a4fb223 100644 --- a/src/navigation/nav-controller.ts +++ b/src/navigation/nav-controller.ts @@ -486,6 +486,13 @@ export abstract class NavController { */ abstract length(): number; + + /** + * Returns the current stack of views in this nav controller. + * @returns {Array} the stack of view controllers in this nav controller. + */ + abstract getViews(): Array; + /** * Returns the active child navigation. */