question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic 2 Beta 11: loading.dismiss() does not work with other overlays

See original GitHub issue

Since Beta 11 I have this issue:

    let loading = this.loadingCtrl.create({content: 'Loading...'});
    loading.present();

    this.geolocationService.geolocate().subscribe(
      (data) => {
        loading.dismiss();

        let alert = this.alertCtrl.create({
          title: 'Title',
          subTitle: 'Text',
          buttons: ['OK']
        });
        alert.present();
      },
      ...
    );

loading.dismiss() does not have any effect, the loading overlay stays open. loading.destroy() removes it but I guess that is not the way to go.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
boryscommented, Sep 4, 2016

Hmm… some time ago I’ve have similar issue - not sure if it is Your problem. loading.dismiss() returns promise - try do something like:

loading.dismiss().then(() => {
   ... (place here code you do after dismiss) 
});

especially when You want to open modal - it may causes some kind of lock f.e.:

WRONG

loading.dismiss();
modal.present(); // Loading is not fully closed!! may cause lock!!!

Works

loading.dismiss().then(()=>
    modal.present();
)

For me, loading component works really unstable, it cause locks (f.e. #7948), so I’ve resigned to use it. I hope it helps…

3reactions
Barathwajacommented, Sep 1, 2016

I’m also using ionic 2 beta 11 , loading.dismiss() works fine…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic 2 Beta 11: loading.dismiss() does not work with ... - GitHub
Since Beta 11 I have this issue: let loading = this.loadingCtrl.create({content: 'Loading...'}); loading.present(); this.geolocationService.
Read more >
Dismiss a LoadingController - Ionic Framework
Hi, I switched to Ionic v4 recently and I have some troubles with LoadingController. I do not succeed to cancel it (when I...
Read more >
Ionic 5 Angular LoadingController Uncaught (in promise)
At first, the problem I had was that loadingController.dismiss() was called before loadingController.create() finished, so I followed the ...
Read more >
Dismissing All Loading Overlays in Ionic 4 - Damir's Corner
In Ionic 4, the dismissAll method for closing all currently open loading overlays has been removed. This might not be such a bad...
Read more >
ionic-angular - UNPKG
ionic -angular/components/loading/loading.d.ts ; 31, * ; 32, * >Note that after the component is dismissed, it will not be usable anymore ; 33,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found