Catch ionViewCanEnter on ion-tabs navCtrl


#1

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:

Kinds regards Manu


CHANGELOG and Milestones not consistent?