I need to do asynchronous serial data processing (sending data to a REST server), and only at the end of all requests do I need to perform another function.
How can I control this flow if each request is asynchronous?
What I need is something like this:
for (var i=0; l<objetos.length; i++){
var o=objetos[i];
Enviar($q, o).then(function(){})
}
//ao término de todas as requisições acima, disparar um novo evento...