No provider for NavController!


#1

Whenever I try to use this controller I have this error but somehow I am using it already on other pages. Why and how?


#2

Hard to tell without seeing your code, but a wild guess would be you forgot to import it in the top of your page or didn’t provide it in your constructor of the specific page.


#3

If it is Ionic 2 verify the below code in your page’s ts file
(ex.) home.ts

Verify you have added the code in your pages ts file

import { IonicPage, NavController, NavParams } from ‘ionic-angular’;

in constructor verify the code

constructor(public navCtrl: NavController) {


#4

Where exactly are you trying this?


#5

Ive already fixed this, was trying to use it in app component but now I know how to do it