Ionic framework 对于ionic 5中的this.app.getActiveNavs()[0]和this.app.\u appRoot.\u getPortal()替换了哪种语法
我把代码从爱奥尼亚3迁移到爱奥尼亚5,这是在爱奥尼亚3中Ionic framework 对于ionic 5中的this.app.getActiveNavs()[0]和this.app.\u appRoot.\u getPortal()替换了哪种语法,ionic-framework,ionic4,Ionic Framework,Ionic4,我把代码从爱奥尼亚3迁移到爱奥尼亚5,这是在爱奥尼亚3中 import { App } from 'ionic-angular'; private app: App let nav = this.app.getActiveNavs()[0]; let portal = this.app._appRoot._getPortal(); 但在爱奥尼亚5中,看起来像是“应用程序”被移动到了NavController方法“navigateRoot”(我不知道如何使用它?)。 还有_getPortal
import { App } from 'ionic-angular';
private app: App
let nav = this.app.getActiveNavs()[0];
let portal = this.app._appRoot._getPortal();
但在爱奥尼亚5中,看起来像是“应用程序”被移动到了NavController方法“navigateRoot”(我不知道如何使用它?)。
还有_getPortal(),我不知道它移到了什么地方?如何获得入口长度
这是ionic3的原始代码
import { App } from 'ionic-angular';
this.platform.registerBackButtonAction(() => {
let nav = this.app.getActiveNavs()[0];
const portal = this.app._appRoot._getPortal();
if (portal.length() == 0) {
if (nav.canGoBack()){
this.app.navPop();
} else {
this.showExitingConfirm();
}
} else {
this.app.navPop();
}
});