1

I have four pages in hierarchy, 0 -> 1 -> 2 -> 3 and I am navigating to them with this.router.navigate(..).

Is there a way, how to get from view (3) directly to view (1)? Calling this.location.back(); twice shows for while page (2), which I do not want to.

Can I pop it directly or navigate to page (1) while keeping (0) still on stack?

Edit: I need to be it working primary on Android/iOS.

Thanks a lot.

Ondrej
  • 503
  • 3
  • 21

1 Answers1

2

Perhaps the skipLocationChange parameter of routerLink or NavigationExtras does what you want.

this.router.navigate('some route', 
    { navigationExtras: { skipLocationChange: true}})

This way the navigation from 1 to 2 or 2 to 3 doesn't add a history entry and navigating back from 3 directly results in going back to 1.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567