Hi community,
How can I intercept and catch
error in the tabs NavController
and proctect at tabsPage with a guard?
I already found ionViewCanEnter on ion-tabs but this did not help me in my case.
What works for me:
ionViewCanEnter
work fine for me when I have control over the NavController
. I guard my page and catch in the calling function
openPage(page: any): void {
this.navCtrl.push(page).catch(() => this.navCtrl.push(LoginPage));
}
if the guard returns false
ionViewCanEnter(): Promise<boolean> {
return this.user.isLoggedIn();
}
How can I do this with a tabsPage
and redirect to another page?
Does anyone have experience with that? Or does ionic provider this out of the box and I missed something?
@jelliben perhaps you had/have a similar issue…
@mhartington: any suggestions on this?
UPDATE:
- already addressed in https://github.com/driftyco/ionic/issues/9056
- waiting for https://github.com/driftyco/ionic/issues/11433 as well
Kinds regards Manu