How to disable page transition animation in Ionic 6 with Angular router.navigate()?

I’m not using the angular [routerLink] inside the html as I can’t for that specific code.

Is it possible to pass a variable to pass a variable like this ? this._router.navigate(['', { animated: false }]).

Or or should I add it somewhere else ?
If possible, I’d like to avoid using IonicModule.forRoot({animated: false}); as I do use such animation elsewhere.

Thx in advance

To navigate in Ionic without animations you can use the NavController:

import { NavController } from '@ionic/angular';

constructor(private navCtrl: NavController) {}

methodName() {
  this.navCtrl.navigateRoot('your-route', { animated: false });
}
1 Like

navigateRoot can clear the history stacks, so use

navCtrl.navigateForward('your-route', { animated: false })
1 Like