After logout reset and go back to home page


#1

I’m using a tabs footer from which I can click a tab and go to the Logout page. If the person accepts, I want him to restart afresh on the home page as if he has landed there for the first time, e.g. navigation stack cleared and the tabs footer visible. How does one accomplish this?


#2

You could use setRoot I guess, I’m not 100% sure I don’t use tabs. But…

You could set a root in the current navigation (in the current selected tab if you use tabs) or set a root for the all app.

Current navigation:

 this.navController.setRoot('YourPage');

Overall root

this.app.getRootNav().setRoot('YourPage');

In your case, I guess also that you would use the second one, the overall one.

Not sure if you should specify the first page of the tabs or the tabs container, I guess you could have a quick try to see if I’m not totally wrong, hope not :wink:

P.S.: If you don’t use lazy loading, remove the quotes around ‘YourPage’