Is there a way to navigate back multiple pages in ionic3 like $ionicHistory.back(numberOfPages) in ionic v1?
Any help? pop() only go back one page. push() does not clear navigation stack. What should I do?
You can use remove() to remove pages, then pop back to the last page that wasn’t removed.
I made a plunker http://plnkr.co/edit/5ciTDxxBOF50F737kKS5?p=preview.
It seems that remove only works if remove count is 1. Is this a bug?
I don’t understand your code. Say you want to go back 5 pages. How about:
- Get index of current view in the current navcontroller.
- Subtract 5.
- From that point in the nav stack, remove 3 pages.
- Pop from your current view to the target page.
Are you saying there’s a bug in that strategy?
I misunderstood the parameter of remove method. I have updated the plunker to fix that.
I had Face the same issue from navigate back between multiple pages so my hierarchy is
homepage->2 page->3 page->4 page, i would like to go back from 4th page to second page i had write
and it works for me.