I am making lots of API calls in my applications i.e say 50.
The total time for completing all the api calls will be around 1 minute. The priority for all the api calls will 2. I have enabled the angular cache.
So in meantime if the user of my applications just want to focus on the some of the api calls among the all i.e say just 6 api calls.
Then once again I will project that 6 api calls with priority 1 .
But still I dont get what I aimed ? i.e these 6 api calls need to receive the data asap.
Kindly refer the below example code .
On Initial load :
for(var i=1,priority=19;i<=19,priority>=1;i++,priority--)
{
$http.get("http://localhost:65291/WebService1.asmx/HelloWorld"+i+"?test=hari",{priority:2})
.then(function(response) { });
}
}
On some event click :
$http.get("http://localhost:65291/WebService1.asmx/HelloWorld7?test=hari",{priority:1})
.then(function(response) { });
}
if you want send multiple http request one shot then use
$q.all
Inside the loop push the http requests to an array and send that http array at once.