I have a bunch of ajax calls in my angular app.
$scope.playerData = function(param) {
showLoader();
$http({
method:"POST",
url:"slim.php/playerData",
data: {'playerId': param},
}).then(function(response) {
ajaxCallDone();
},function(response){
handleError();
});
}
Most of my other ajax calls using Angular have same syntax. I notice that my calls are all made synchronously. If I have 5 calls to the server, each executes ONLY after the other has returned. This is not what I need. How can I make these calls synchronously. I read about $q and promises, but I am unable to understand them. I following but it did not help:
playerApp.config(function ($httpProvider) {
$httpProvider.useApplyAsync(true);
});
Any pointers are greatly appreciated!!