I assume your typeahead markup looks like this:
<input [...] typeahead="item in getItems($viewValue) | filter: $viewValue">
Why does it not work:
, . getItems getListofNames, - $http. getListofNames() - , .
:
. , getItems. . , , ( $viewValue), . .
, :
$scope.getList = function getListofNames(name) {
return $http(...}).then(
function(response){
return filteredArray;
}
);
};