<ion-back-button> on nested outlet in Ionic 7

HI!

I’m using Ionic 7 on Angular.

I’ve searched all the web but it is impossibile to find the answer to this question: how can I make behave in a way that - in a nested outlet - correctly goes back to the previous view instead that to the home app?

Thanks…

The way I use it is to use this.location.back (). This gets to the latest url you were.

you import it from import { Location } from '@angular/common'; and have to declare it on your constructor.

1 Like

It works, thanks! Only a minor problem: how, using this.location.back(), can I replicate the transition-animation Ionic use with navigate() method?

I don’t know, as it’s an angular module, I think there has to be a way, look for the docs and good luck!

1 Like