a quick overview of our set up :- MVC web application for front end, this sends REST requests to an MVC Web API.
This is all working great, however, we have now introduced AngularJS to allow us to use 2 way data binding with javascript.
This is a really good framework, and we have started to utilise the ajax $http requests.
so, within angular, we are using $http to call the MVC controller which calls the REST WEB API, data is returned, serialised as JSON within the controller and sent to the angularJS request for 2 way data binding.
This issue that we are having, is that we are now making multiple HTTP Requests in one go, however, each request seems to wait for the previous to have been completed and we are struggling to work out why? we where expecting all the requests to be independent of each other, so that there would be no lag or wait time...
If anyone can offer any advise, it would be greatly appreciated
ps - I hope that all made sense
angular code below:-
$scope.LoadResults();
$scope.GetHistory();
$scope.GetUserDetails();
$scope.GetHistory = function () {
$http.post('/user/GetHistory/', $scope.data).success(function (data, status, headers, config) {
});
}
$scope.GetUserDetails= function () {
$http.post('/user/GetUserDetails/1234', $scope.data).success(function (data, status, headers, config) {
});
}
$scope.LoadResults = function () {
$scope.data = {
frequency: $scope.frequency,
direction: $scope.direction,
view: $scope.view
};
var userid = $('#id').val();
var url = '/user/' + userid + '/GetUserResults/';
$http.post(url, $scope.data).success(function (data, status, headers, config) {
if (data.msg != '') {
$scope.resultssummarydata = data.aaData;
}
else {
$scope.errors.push(data.error);
}
});
}