Closed tonyawad88 closed 7 years ago
Hey guys this issue is still happening on latest version when calling this.loading.show() for me :/ any workarounds or solutions found ?
I have already answered it a year ago... Ionic mixes callbacks from a web worker thread which are then sent via callbacks to the app. This means you cannot simply show a progress dialog or do practically anything as long as you're not in main thread. Instead you must use NG-ZONE as so:
import {ViewChild, Component, NgZone} from '@angular/core';
....
constructor( private zone: NgZone )
...
observer_callback() { this.zone.run( () => { // Congrats - you're in main thread now. Stupid things won't happen anymore. } ); }
With Regards,
Rubi Mazaki Email: rubimazaki@gmail.com
On Thu, May 4, 2017 at 2:27 PM, YannKauderer notifications@github.com wrote:
Hey guys this issue is still happening on latest version when calling this.loading.show() for me :/ any workarounds or solutions found ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/driftyco/ionic/issues/6209#issuecomment-299159230, or mute the thread https://github.com/notifications/unsubscribe-auth/ABw6-TbsdHIUu6vTmvDbAmFmP8NF44VJks5r2bYjgaJpZM4IJOHs .
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Short description of the problem:
I have a welcome page that invokes the Loading service in its constructor. As soon as the page loads for the first time the error / exception is thrown.
What behavior are you expecting?
No exceptions thrown.
Steps to reproduce:
ionic start MyIonic2Project tutorial --v2 --ts
3 . Check the console for the exception
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 2.x
Plunker that shows an example of your issue
http://plnkr.co/edit/fA0KB70ggJd0nptNvYpl?p=preview
Run
ionic info
from terminal/cmd prompt: (paste output below)