I have the following function below:
public requisicaoXPTA() {
this.database.executeSql("SELECT * FROM tbl_xpta",
[]).then((data) => {
// o resultado retorna aqu na variável data
}, (error) => {
console.log(error);
});
}
When I use this function I do this:
this.requisicaoXPTA();
this.atualizar();
Most of the time, the atualizar()
function is executed before requisicaoXPTA()
. I would like to execute the atualizar()
function after having made the request in the table. What better way to do this synchronously?