$scope.results = searchService.CallWeb($scope.userName);
I am using the above line of code inside my angularjs controller. The method searchService.CallWeb()
is inside an angularjs service that makes a jquery ajax call. The Jquery ajax call is successfully executed (I am throwing the results into an alert inside jquery success ), but the service method searchService.CallWeb()
returns before it can get a response from the ajax call. Hence I am not able to get the results back to my controller. How do I fix this?