How to get list element in $http


#1

I can’t access the list element when $http is success.For example,
for(i=0;i<$scope.list.length;i++){
$http.post(url,arg)
.success(function(data){
$scope.list[i] = data; //$scope.list[i] undefined here!!!
});
}

How to solve it?