Can't use NavController on Root (app.ts)?


#1

I make an App with my own style. So i use Modalto show the menu list. and i need Modal on every pages. But i cant use Nav:NavController on app.ts. This the way i tried.
constructor(platform: Platform,Nav:NavNavController) {} and i got No provider for NavController!
Then i try this @ViewChild('nav') nav: NavController; When press button to show the modal i got Cannot read property 'present' of undefined for the line i code this.nav.present(modal);

Anyone help me please. Thanks you and sorry for my bad english.


#2

It’s working for me:

import {App} from ‘ionic-angular’;
nav: NavController;
constructor(…, app: App){
this.nav = app.getRootNav()
this.nav.push(SomePage)…
}