No provider for NavParams!


Hi, I created a basic tabbed application using :
ionic start myApp tabs --type=angular

My has :

import { Component } from '@angular/core';
import { TestPage } from '../test/';
import { NavController, NavParams  } from '@ionic/angular';
  selector: 'app-home',
  templateUrl: '',
  styleUrls: ['']
export class HomePage {
  constructor(public navCtrl: NavController, public navParams: NavParams) {}

But i am getting the error as :

Uncaught (in promise): Error: StaticInjectorError(AppModule)[HomePage -> NavParams]: StaticInjectorError(Platform: core)[HomePage -> NavParams]: NullInjectorError: No provider for NavParams!

How to fix this:

my Ionic version is 4.0.0 beta 7


If you are looking into navigate to test page refer the below documentation for ionic navigation between pages.

Ionic Nav controller and add the pages you have created into imports in the app.module.ts


NavParams doesn’t exist in v4


This is not true. NavParams exists, but it can only be used on things like Modals


yes true, modals and popovers