No provider for NavController!


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


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.


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) {


Where exactly are you trying this?


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