I want to create a wrapper around my API calls in AngularJS like
function MakeCall (url){
$http.get(url, config).success(successfunction);
return response;
}
Can you help me how to wait for the call to complete and get the final response from the call. In above code the "return response" is what I want to get after the completion of call. This function will be used like
response = MakeCall("to some url");