Need to run a series of HTTP calls, and wait for them all to complete? Use $q.all
.
This won’t work:
Do this instead:
Run the promsies in order (not in parallel)
When you queue up promises like above, they all start at the same time. But what if you want them to run in the order you called them?
You can build up a chain of promises:
$q.when
is used to kick off the chain with a resolved promise.