I have a home page which is my first screen.
after i navigate to some pages On clicking a button i need to get back to the home page without back button
for navigation i use [navPush]='pageName';
This navPush
automatically generates back button. But i dont need the back button when i go back.
I tried navPop
it is working fine but the problem is it takes to the next page only .
Example
if i have 10 pages from 10th page i have to come to 1st page using ionic
navPop
i am not able to achieve this .When i tried with navPush i am able to get back but i am not able to avoid the back button in homepage.
Question:
Is there anything else i am missing how to avoid the back button generated using
navPush
ornavPop
On clicking a button I need to get back to the home page without back button
Please take a look at this working plunker.
You can use the setRoot() method like this:
this.navCtrl.setRoot(HomePage);
If you really need to use the push
method instead of the setRoot
, you can also try with the showBackButton() method from the ViewController
showBackButton(Set): Set if the back button for the current view is visible or not. Be sure to call this after ionViewWillEnter to make sure the DOM has been rendered.