jennifer jhonson
jennifer jhonson

Reputation: 27

issues migrating ionic 1 code to ionic 4/5

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

Answers (1)

H S W
H S W

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

Related Questions