私はイオンにはとても新しいので、前のページに戻るのに苦労します。 エラーキャッチされていない(約束しています):ナビゲーションスタックには少なくとも1つのルートが必要です。 しかし、login()では、ルート(LoginPage)の上にTabsPageを押します。 pop()ではLoginPageに戻ります。イオンポップページが機能しない
お手伝いできれば嬉しいです。ここで
は私のコードは次のとおりです。
myApp.ts:
export class MyApp {
rootPage:any = 'LoginPage';
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
});
}
}
login.ts:
public login() {
this.showLoading()
this.auth.login(this.registerCredentials).subscribe(allowed => {
if (allowed) {
this.nav.push(TabsPage);
} else {
this.showError("Email ou mot de passe incorrect");
}
},
error => {
this.showError(error);
});
}
タブ:
export class TabsPage {
tab1Root = OrdersPage;
tab2Root = AboutPage;
tab3Root = ProfilePage;
/**
* @constructor
*/
constructor(private navCtrl: NavController) {}
}
profile.ts:
public logout(){
this.auth.logout().subscribe(logedout => {
if(logedout){
this.navCtrl.pop();
}
});
}
ありがとうございます。
あなたは 'TabsPage'について話しますが、私はそのコードを見ません。 –
@Protectatorあなたの答えをありがとう。私の質問が更新されました – OTmn
'tab3Root = ProfilePage;'を参照してください。つまり、ルートを 'Profile'に設定するのでしょうか?はいの場合、それはあなたが 'pop'を使って戻ることができない理由です:Profileがルートになりました。 –