1.使用popTo方法进行跳转:
this.navCtrl.popTo(this.getViewByName('SpecifiedPage'));
调用以下方法获取指定页面的ViewController
getViewByName(name: string) {
let views = this.navCtrl.getViews();
console.log(views);
for (let view of views) {
if (view.name === name) {
return view;
}
}
}
2.不使用popTo,直接push
this.navCtrl.push(SpecifiedPage);
从指定索引(下面例子指定页面SpecifiedPage的索引为2,即第三个页面)的导航堆栈中删除后面所有的页面
this.navCtrl.remove(2,this.navCtrl.length()-2);