diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 05baab9aa9..91edc2d10e 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -335,6 +335,26 @@ export class NavController extends Ion { return Promise.resolve(); } + /** + * Removes a view from the nav stack at the specified index. + * @param {TODO} index TODO + * @returns {Promise} TODO + */ + remove(index) { + if (index < 0 || index >= this._views.length) { + return Promise.reject("Index out of range"); + } + + let viewToRemove = this._views[index]; + if (this.isActive(viewToRemove)){ + return this.pop(); + } else { + this._remove(index); + viewToRemove.destroy(); + return Promise.resolve(); + } + } + /** * Set the view stack to reflect the given component classes. * @param {TODO} components TODO diff --git a/ionic/components/nav/nav.ts b/ionic/components/nav/nav.ts index 5aa2b388a9..ffc10b4000 100644 --- a/ionic/components/nav/nav.ts +++ b/ionic/components/nav/nav.ts @@ -437,9 +437,7 @@ class Pane { showNavbar(hasNavbar) { this.navbar = hasNavbar; - if (!hasNavbar) { - this.renderer.setElementAttribute(this.elementRef, 'no-navbar', ''); - } + this.renderer.setElementAttribute(this.elementRef, 'no-navbar', hasNavbar ? null : '' ); } } diff --git a/ionic/components/nav/test/basic/index.ts b/ionic/components/nav/test/basic/index.ts index 3f6ead453f..d20838f9bf 100644 --- a/ionic/components/nav/test/basic/index.ts +++ b/ionic/components/nav/test/basic/index.ts @@ -104,6 +104,7 @@ class SecondPage {
+