AngularJS Typeahead给出了一个关于“的错误”;“火柴”;

AngularJS Typeahead给出了一个关于“的错误”;“火柴”;,angularjs,bootstrap-typeahead,Angularjs,Bootstrap Typeahead,我的看法是: <input type="text" ng-model="receivingSku" placeholder="Locations loaded via $http" typeahead="sku for sku in getSku($viewValue) | filter:$viewValue" typeahead-on-select="selectedSku()" class="form-control"> 返回的sku是一个类似以下的数组:['1221','1

我的看法是:

 <input type="text" ng-model="receivingSku" placeholder="Locations loaded via $http" typeahead="sku for sku in getSku($viewValue) | filter:$viewValue" typeahead-on-select="selectedSku()" class="form-control">
返回的
sku
是一个类似以下的数组:
['1221','193A2']

键入内容时,会出现错误:

Error: matches is undefined .link/getMatchesAsync/<@http://localhost:3000/lib/angular-bootstrap/ui-bootstrap-tpls.js:3186 zd/e/l.promise.then/A@http://localhost:3000/lib/angular/angular.min.js:93 zd/e/l.promise.then/A@http://localhost:3000/lib/angular/angular.min.js:93 zd/g/<.then/<@http://localhost:3000/lib/angular/angular.min.js:94 Ad/this.$get</h.prototype.$eval@http://localhost:3000/lib/angular/angular.min.js:102 Ad/this.$get</h.prototype.$digest@http://localhost:3000/lib/angular/angular.min.js:100 Ad/this.$get</h.prototype.$apply@http://localhost:3000/lib/angular/angular.min.js:103 pb/h@http://localhost:3000/lib/angular/angular.min.js:126 Yc/c/<@http://localhost:3000/lib/angular/angular.min.js:27 q@http://localhost:3000/lib/angular/angular.min.js:7 Yc/c@http://localhost:3000/lib/angular/angular.min.js:27

错误:匹配项未定义。link/getMatchesAsync/似乎我需要返回承诺,阿拉巴马州:

  $scope.getSku = function(skuValue) {
    return ItemService.search(CompanyService.getCompany()._id, skuValue).then(function(response) {
      var skus = response.data.items.map(function(e) {
        return e.sku;
      });
      return skus;
    });
  }

返回整个搜索服务以及回调的内部返回。
  $scope.getSku = function(skuValue) {
    return ItemService.search(CompanyService.getCompany()._id, skuValue).then(function(response) {
      var skus = response.data.items.map(function(e) {
        return e.sku;
      });
      return skus;
    });
  }