Home » Javascript » Ionic 3 – LoadingController.present() taking too long to be rendered

Ionic 3 – LoadingController.present() taking too long to be rendered

Posted by: admin November 1, 2017 Leave a comment

Questions:

When I’ am calling a loading popup like this:

send(message): void {
   // calling a provider of alerts
   this.loadingProgress("open", false, message.destinatarios.length);
   var messageList = [];
   var clientes = [];

   for (var i = 0; i < message.destinatarios.length; i++) {
      //sincronous operations 
   }

   for (var j = 0; j < clientes.length; j++) {
      //asyncronous operations
   }
}

loadingProgress(action, navPage, total) {
   this.load = this.loadingController.create({
      content: 'Aguarde... ',
      spinner: 'ios',
      dismissOnPageChange: navPage //se permanecer na mesma tela -> false
  });
  this.load.present();
}

The problem is that is taking more than 15 seconds to the loading screen to popup.
I’m wondering if calling ascyncronous operations has something to to with it…

Answers: