Routing Issue

I am Using Ionic 4, I am getting Error.

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


constructor(private navControl: NavController) { }
 comments() {
    this.navControl.goForward('/user-comments');
  }

I am getting Below Error

ERROR in src/app/activity-feeds/public-feeds/public-feeds.page.ts(21,21): error TS2339: Property 'goForward' does not exist on type 'NavController'.

It is saying there is no Property so I was changed to navigateForward

But If I am changed to navigateForward and tr y to use npm install next time Again same Issue could you please help me out.

How we can solve this issue what is the difference between navigateForward and goForward

Thanks in advance !!!

1 Like

In one of the recent beta updates the goRoot, goForward, and goBack methods were renamed to navigateRoot, navigateForward, and navigateBack. Just make sure you are using the latest version of the beta and you should be fine.

1 Like

Thanks for your replay, actually Yes, I am using latest version only. if I changed from goForward to navigateForward and usingnpm install again it saying navigateForward is not found and it asking to change the goForward and afternpm install again same issue.it is very strange.

Check that the dependencies in your package.json file look like this:

  "dependencies": {
    "@angular/common": "~6.1.1",
    "@angular/core": "~6.1.1",
    "@angular/forms": "~6.1.1",
    "@angular/http": "~6.1.1",
    "@angular/platform-browser": "~6.1.1",
    "@angular/platform-browser-dynamic": "~6.1.1",
    "@angular/router": "~6.1.1",
    "@ionic-native/core": "5.0.0-beta.15",
    "@ionic-native/splash-screen": "5.0.0-beta.15",
    "@ionic-native/status-bar": "5.0.0-beta.15",
    "@ionic/angular": "4.0.0-beta.7",
    "core-js": "^2.5.3",
    "rxjs": "6.2.2",
    "zone.js": "^0.8.26"
  },

Specifically, check that the @ionic/angular version is beta.7.

Hi,
which is the difference between navigateRoot and navigateForward going from page x to page y?

Does navigateForward allows you to go back to page x while navigateRoot not?

Thank you very much

cld