[Ionic 4] Remove page from navigation (Router / NavController)


#1

Hi, I’m using both methods when navigating, this one when I need to pass parameters:

this.router.navigate(['categories/', categoryId], { queryParams: { title: name } });

And this one when not:

this.navCtrl.navigateForward('home');

My App logic is something like this (arrows define the allowed direction of navigation):
Login > Home >< Categories
So when the user goes to Home I block going back to Login by closing the app.

The problem here is that the user can log out, and the app navigates to Login again. In this step, if the user has been logged in, and then used the logout, the Login page is reused and its constructor is not called again.

Is there any way to remove this view from history navigation and force rebuilding it for calling the constructor? I’m currently going to Login again using navigateForward and I emulate the behaviour that I expect putting my code in ionViewDidEnter.

I’m using:

    "@ionic/angular": "^4.0.0-beta.12",
    "ionic": "^4.1.2",

Thanks in advance.