Nav.pop() scope


Simple question. I have a tab. I am using nav.push to add views. I want to replace the current view instead of add to the nav stack. I have a condition if(this.nav._views.length > 1) {this.nav.pop()}; Then I try this.nav.push().

What I end up with is the menu (rootpage) for the tab gets popped off, even though it is the first item in the nav array.

Why is this happening? How do I replace the last page in the nav array?