I am try to call function $scope.getThisFunction($scope.Num)
after completion of for loop, i tried below code but not working. Any suggestion?
for(var i = 0; i < $scope.selection.length; i++) {
$http({
method: "POST",
url: '/url/' + $scope.Num + '/' + $scope.selection[i]
}).then(function mySucces(response) {
if(i == $scope.selection.length - 1) {
$scope.getThisFunction($scope.Num); //not working
}
}, function myError(response) {
alert("SORRY, SOME TECHNICAL ERROR OCCUR");
});
}