Is there any way of adding a callback method to a function that calls service in a function i am calling multiple service methods and i want to a set a callback method to that function. I tried this but no luck
$scope.MyFunction() = function()
{
//Multiple Service calls
$scope.callService1 = service.CallService1() //returns true on success
$scope.callService2 = service.CallService2() //returns true on success
$scope.callService3= service.CallService3() //returns true on success
if($scope.callService1 && $scope.callService2 && $scope.callService3)
{
$scope.CallbackMethod ();
}
}
$scope.CallbackMethod = function()
{
alert('CallbackMethod')
}
I tried this one too but its not in sync as the service calls takes some time.
$scope.MyFunction() = function(CallbackMethod)
{
//Refer Above Code
}
CallService service Method is something simple like
$http.post('/InstStrategy/ReadAll').then(function (response) {
return true
});
undefined.