I need to execute a series of APIs in a loop, but I want the second loop to start only after receiving the result from the last API call in the first loop. How can I achieve this?
for(var i=0; i<array.length; i++ )
service.getfunction(array[i]).then(function(response) {
service.getfunction1(response).then(function(response) {
service.getfunction2(response).then(function(response) {
service.getfunction3(response).then(function(response) {
console.log(response);
});
});
});
});
)