How to use this.navCtrl.push in app.components.ts


#1

I’m trying to use this.navCtrl.push(somepage) on an icon in the flyout menu that is located in the ion-toolbar of app.html. I seem to be able to import the NavController too app.componets.ts but I cant add it to the constructor without it erroring. How in the world can I push from the app.componets.ts, it making me crazy please help


#2

Hello,

how your app.html looks and how your app.component.ts looks?

Maybe in your html is a ion-nav defined, that in app.component.ts is catched with @ViewChild.

Best regards, anna-liebt


#3

hey, thanks that helped.
using @ViewChild(Nav) nav;
then
this.nav.push(SomeOtherPage);

thanks for the help again