My problem is this. I am getting a json from a webservice and doing insert or update in an sqlite database on the device I use $ ionicLoading.show () when clicking the button and it closes when the request with the server ends. Only due to being too much data the processing in the bank continues and I wanted to close the loading only when the data processing in the bank finishes. Would anyone have any idea what to do?