After login erase my NavStack [Solved]

Is there anyway to clean my NavStack after login?

After my login I want the back button to disappear and my hamburguer button to show

reset the root on the navController

I tried using nav.setRoot(this), but it is still showing the back button


I’m doing like this, but it doesn’t seem to work.

use setPages to replace whatever is in the navstack with a single item which is the new item you want to be the root. For example:

this.nav.setPages([{page: HomePage}]