How to post synchronous ajax request or how to set async as false in angular $http service.
Example of my service is
$http.post("qa.test.net/rest/customtableitem.profile.interests?format=json", JSONobject)
My controller is
for (var i = 0; i < Insert.length; i++)
{
if (Insert[i].ItemID == null)
{
TestInterestService.insertTest(Insert[i]).success(function (data) {
}).error(function (data) {
});
}
}
In this data is getting inserted asynchronously not in order for that reason it is messing the order entered I want to insert in synchronous manner. Any suggestions
EDIT That did not solved my problem, I was looking for pointing to the service where we can sent async as false in request headers.