Doubt about $ionicLoading.Hide() closure

Asked

Viewed 41 times

-1

My problem is this. I am receiving a json from a webservice and doing Insert or update in a sqlite database on the device I use $ionicLoading.show() by clicking on the button and it closes when the request with the server ends. Only because it is a lot of data, the database processing continues and I wanted to close the loading only when the data processing in the database is finished. Would anyone have any idea what to do ?

  • Is the webservice returning before finishing operations in the bank? Would you be able to change it?

  • The webservice is not normal. I start loading.show() I make the request for $http.get after I get all the json from the webservice it closes the $loading and then start doing the operations with the bank. I would like the $loading only to close after the bank.

1 answer

0

You could call the loading Dismiss() only on the return of the service call?

For example:


 let loading = this.loadingController.create({
        content : "Loading..."
    });
loading.present();

service.getServico(items => { loading.Dismiss(); } });

Browser other questions tagged

You are not signed in. Login or sign up in order to post.