I call an http service, loop through the results and each item acts as the key for another http-call.
What's the best way to do that?
I guess calling $http from within another $http call does not work as the outer $http-loop may just exit before the inner $http calls have finished?
// pseudo code:
$http.get(url).then((response) ->
foreach response.data as item
$http.get(item.url).then((response) ->
foreach response.data as item
)
return result
)
Doesn't really work, right?
$scopeinside thethen, it shouldn't matter when the response is returned.