Can not Get Current Active Page Name in app.component.ts

I Have Tried The Following Things in Ionic 3


navCtrl.getActive().component this Code no provider for NavController in app.component.ts this Code no provider for ViewVontroller in app.component.ts

//returns view controller obj
let view = this.nav.getActive(); It Works But in --prod the object retuns only t

Please Reply me Soon

I am also getting the same issue. Debug builds are fine but prod builds always return something like 1 or n

I have also tried app.getRootNavs()[0].getActive().name with no luck either

Seem to have found the issue here, with prod builds the app is compiled, resulting in the short names.

Using something like the ionViewDidEnter() to then fire an event for the current page name (as a string) or write to storage works for keeping track of the current page

1 Like