Just starting out with Angular and facing a challenge with handling downloaded JSON data. I wrote this function:
for (var i = 0; i < $scope.Objects.length; i++){
$http.get($scope.Objects[i]["Commit"]).success(function(data) {
Commit = data;
})
.error(function(data, status, headers, config) {
alert("Sorry we have some troubles... Try another time");
});
for (var j = 0; j < Commit.length; j++){
//Data processing logic here
}
$scope.Objects[i]["Commit"] = Commit;
}
The issue arises when trying to handle the code after $http
, as it's not within a $scope
or function. Is there a way to use this code snippet as is in pure JS?