I am facing an issue with my function containing multiple $http get requests. Despite needing to call another function after each request is completed, it always executes the function before the request finishes processing. What could be causing this and are there any solutions to resolve it?
$scope.json=function(){
$scope.loading = true;
$http.get(DataElementUrl).then(function (response) {
if (!response.data == "")
dataElementJson = response.data;
});
$http.get(categoryComboUrl).then(function (response) {
if (!response.data == "")
categoryComboJson = response.data;
});
$http.get(categoryUrl).then(function (response) {
if (!response.data == "")
categoryJson = response.data;
});
check++;
$scope.getJson();
};