You can setRoot without using angular's router. This code works in Ionic 4
import { NavController } from '@ionic/angular';
constructor(private navCtrl: NavController) {
}
navigateRoot()
navigateRoot(url: string | UrlTree | any[], options?: NavigationOptions): Promise;
this.navCtrl.navigateRoot('/app/profile');
or if you want forward/back
animation:
this.navCtrl.navigateRoot('/authentication', { animationDirection: 'forward' });
setDirection() with angular's router
setDirection(direction: RouterDirection, animated?: boolean, animationDirection?: 'forward' | 'back'): void;
with navigate:
this.navCtrl.setDirection('root');
this.router.navigate(['/app/profile']);
with navigateByUrl:
this.navCtrl.setDirection('root');
this.router.navigateByUrl('/app/profile');
or using directive:
<a routerLink="/app/profile" routerDirection="root">Proceed</a>