Reputation: 27
I am migrating ionic 1 code to ionic 5. I do not have much experience with ionic 1. So some code is bit confusing. I would like to know what is equivalent of following code in ionic 4/5.
$ionicHistory.clearCache();
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true
});
If someone knows then please let me know. Thanks in advance
Upvotes: 0
Views: 106
Reputation: 7119
It can be done like this:
import {Router, NavigationExtras } from ‘@angular/router’;
let navigationExtras: NavigationExtras = {
skipLocationChange: true,
replaceUrl: true
};
//Where home is the page where app will navigate
this.router.navigate([’/home’], navigationExtras);
Upvotes: 2