Ionic 6 navigateroot not working

I’m using ionic 6 angular. when I used navCtrl.navigateroot(‘page’) it’s goes that page. After that press the android hardware back button it goes to the previous page. how to fix that issue

You have to use navCtrl.navigateForward to use hardware back button to go back page I hope it helps you

no, i want to set root page ionic 6 not working that navigateroot() function correctly

I prefer use angular routing
In constructor

constructor(
       ...
      private route:Router
       ...
  ) { ... }

And route

this.route.navigateByUrl('/page', {replaceUrl: true})

With replaceUrl = true/false if i need page in history navigation

It’s working. Thank you