Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229610

NavController.getActive() does not seem to work in Ionic View

$
0
0

When using this in my app.component.ts:

export class MyApp {
    @ViewChild(Nav) nav: Nav;
..
..

the code this.nav.getActive().component.name returns the name of the current page, as expected, when running the app in browser with ionic serve. It also works when using the Ionic Dev app, and also when i run the app in a simulator. But - I need this to work in when i run the app in the Ionic View also, and it doesn’t. I don’t get anything when trying to print out the value of this.nav.getActive().component.name in the app.html. Is there any way i can get this to work with Ionic View?

Thanks in advance.
Lars


Viewing all articles
Browse latest Browse all 229610

Trending Articles