我正在尝试将 ngTagInput 与自动完成一起使用,但出现以下错误:
angular.min.js:117 TypeError: a.filter is not a function
at d (ng-tags-input.min.js:1)
at ng-tags-input.min.js:1
at angular.min.js:130
at n.$eval (angular.min.js:144)
at n.$digest (angular.min.js:142)
at n.$apply (angular.min.js:145)
at l (angular.min.js:97)
at H (angular.min.js:101)
at XMLHttpRequest.u.onload (angular.min.js:102)
HTML
<tags-input ng-model="selectedList">
<auto-complete source="getData($query)"></auto-complete>
</tags-input>
Javascript
$scope.getData = function(query) {
var request = {
// GET request is defined here
};
return $http(request).success(function(response, status) {
var defer = $q.defer();
defer.resolve([
{ 'text': 'just' },
{ 'text': 'some' },
{ 'text': 'cool' },
{ 'text': 'tags' }
]);
return defer.promise;
});
};