-1

I have steps, for that using ion-nav/ion-nav-link, problem is sometimes I want to start from the last step(components) and go back step by step. How can I implement that? For regular situation is fine when I start from first step and go forwards, can go back … but do not know how can I start from end and and go back(or forwards after go back). Thanks

Ali
  • 57
  • 1
  • 6
  • do you mean go to the other pages and click back button for go back? – Meow Dec 08 '22 at 08:48
  • ion-nav do not change pages, it change component in one page, I want start to last component and be able to go back https://ionicframework.com/docs/api/nav – Ali Dec 08 '22 at 10:04
  • please add some code for better understanding. May be a Stackblitz link with example. – Najam Us Saqib Dec 08 '22 at 12:04

1 Answers1

-1

Each time you use ionic nav to go to another page/component, it places a new view on top of the stack (think of like a deck of cards). On the page/component that shows, you can place a back button that navigates back to the previous component and it removes that page/component from the navigation stack:

1 page > 2 page > 3 page (back button pressed) > 2 page

So from what you are trying to do, you cannot. But you can just start from the last page/component like you said and just go backwards from there using ionic nav without using a back button on either of the pages:

3 page > 2 page > 1 Page

or you can use slides, and place components in there. they move back and forth with ease: https://ionicframework.com/docs/api/slides

more info can be found in thier docs: https://ionicframework.com/docs/angular/navigation