No provider for NavController! Ionic 3
I have resolved this problem in ionic 3 by following code.
import {App} from 'ionic-angular';
constructor(public app: App){}
login() {
this.app.getActiveNav().push(XxxPage);
}
Well, why do you try to import NavController? You have @ViewChild(Nav) nav: Nav;
you can use it.
You must remove NavController from injecting in your constructor
Replace your line
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,private settings: SettingsProvider,private navCtrl: NavController) {
with
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,private settings: SettingsProvider) {
Then replace the line
this.navCtrl.push(HomePage);
with
this.nav.push(HomePage);
Try using getActiveNav()
Like this,
import {App} from 'ionic-angular';
constructor(public app: App){}
login() {
this.app.getActiveNav().setRoot(Home);
}