Property 'getActiveNav' does not exist on type 'App'. ionic-angular 3.5.2


#1

Hi all ! Could anyone suggest please … after update ionic-angular to 3.5.2 - build failed … Property ‘getActiveNav’ does not exist on type ‘App’. Where to see changes and what use now ?


#2

Please show us the code where you use getActiveNav.
Also post your ionic info output.


#3

Sujan12, good day !

import { App} from 'ionic-angular';

  let navig = this.app.getActiveNav();
      if (navig.canGoBack()) {
        if (this.updateNewProvider.updateInProgress) {
          this.ConfirmExit();
        } else {
          if (this.confirm != undefined){
            this.confirm.dismiss();
            navig.pop();
          }else {
            navig.pop();
          }
        }

Your system information:

Сordova CLI: 7.0.1
Ionic Framework Version: 3.5.2
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 2.0.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.0
Xcode version: Not installed

#4

Do you also define app in the constructor to be of type App?
What do you get on console.log(this.app) before let navig?


#6

getActiveNav() was deleted in Ionic 3.5.2

in my case I replaced the code with getRootNav() which is unfortunately marked as deprecated (I don’t use tabs)

P.S.: About this deprecation getRootNav() deprecated, use getRootNavById(): what's the value of the root nav id?


#7

reedrichards, is helps, thanks …


#8

Opened this issue regarding the deletion of active nav:


#9

Hi all,

Whoops, I am really sorry about that. We should not have deleted this method. I think I must have been using the refactoring tools in VS Code and that’s why I didn’t notice. I will put this back in and release a patch today.

Once again I’m very sorry.

Thanks,
Dan


getRootNav() deprecated, use getRootNavById(): what's the value of the root nav id?
#10

3.5.3 was published yesterday, this.app.getActiveNav() is back :slight_smile:

Thx @danbucholtz!