jeudi 6 août 2015

Cordova - Asynchronous SQLite queries and flow of control

I'm using Ionic Framework with the ngCordova module. I store a list of objects in a SQLite database.

My problem is that the queries are asynchronous. So I'm using lots of callbacks to get the results. But I also should load a view showing a list of these objects (stored in the database). This view can be opened by the user in every moment pressing a button (so a callback doesn't work in this case). How could I ensure that my data are ready? I'd like to wait for the query result and then allow to load the view, but I can't find a way.

May you help me?

Thank you.

Aucun commentaire:

Enregistrer un commentaire