I need a situation to be handle where I need a loop to execute multiple times for http get call. Here is my code
for(i = 1; i <= 5; i++){
console.log(i);
var req = {
method: 'GET',
timeout: 30000,
url: url
params: {page_id: i}
};
$http(req).success(function(data, status, headers, config) {
console.log(data);
}).error(function(data, status, headers, config) {
console.log('error');
});
}
I need this to handle but not getting the values in order.