I have a set of APIs which I have to run inside a for loop
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);
});
});
});
});
)
Second loop should start only after I got result from last getfunction3 API for first loop. How can I do this?