I\'m using Angular Material md-autocomplete
in my project. In that I\'m getting the suggest listing from the Service Host via ajax call using $http
I struggled with this as well for a bit. Basically you should actually be returning a promise that returns the content.
This is my "search" function
$scope.searchData = function (searchTxt) {
return $http.get('/TestSearch', { params: { searchStr: searchTxt } })
.then(function(response) {
return response.data;
});
};
Also I'm not sure what version of angular you're running but I think .success was deprecated.
And here is my md-autocomplete as well
{{item}}
EDIT1: Sorry original JS was in TypeScript. Fixing that now