ionic-framework: [v2 beta.11] LoadingController broken with Tabs on default Tab

Something broke between 2.0.0-beta.10-201608041720 and 2.0.0-beta.10-201608051404 on the updated LoadingController component.

Steps to reproduce:

  1. Set a tabs page as root
  2. Add a Loading component to the default selected tab
  3. Run loading.present()

I’m running into this error: EXCEPTION: Error: Uncaught (in promise): TypeError: activeNav.getActive is not a function. Running through the trace, it looks like Loading can’t figure out the current view. Note that this does not happen with 2.0.0-beta.10-201608041720 the previous version.

Cordova CLI: 6.3.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10-201608051404
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.2.0
Xcode version: Xcode 7.3.1 Build version 7D1014

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 23 (5 by maintainers)

Most upvoted comments

I had the same issue with beta 11. And this is my workaround:

let loading = this.loadingCtrl.create({ content: 'Please wait...' }); try { loading.present(); } catch (e) { }

I even put the above code in my service class. It won’t launch the loading panel when you fire up your app. But it will as soon as everything settles in.

+1

+1

Same here, however, there is a hacky work around… setTimeout(() => { let loader = this.loadingCtrl.create({ content: "Please wait..." }); loader.present(); doStuffAndThings() .then(() => { loader.dismiss(); }); }, 0);

@jgw96 @LloydVincent I already tried both the angular and ionic lifecycle events ngOnInit() and ionViewDidEnter and both have different results:

  • ngOnInit() throws the same error I have above
  • ionViewDidEnter script dies at loading.present()

ionics lifecyle events for this problem work perfectly in the version just before re: 2.0.0-beta.10-201608041720. As I mentioned this is an issue exclusive to the latest release.