私はAngularを学んでいて、それをモックアップで実装しようとしました。Angular typeaheadを実装しようとすると、typeaheadの結果は未定義として表示されます。 HTMLのコードスニペット、Angular Typeaheadの結果は未定義です
<input type="text" id="search" ng-model = "selectedEnterprise" class="form-control form-design input-md enable collapse" placeholder="search for an enterprise" uib-typeahead = "enterprise.name as vm.enterprises.name for enterprise in vm.enterprises | filter:$viewValue | limitTo : 3 ">
コントローラコードスニペットIは、バックエンドのためのMongoDBとNodeJSフレームワークを使用
$http.get(path + '/enterprise/all/' + num)
.then(function success(response) {
vm.enterprises = response.data;
temp = vm.enterprises;
console.log(vm.enterprises);
}, function error(response) {
console.log(response);
});
。
を参照してください
ようにする必要があります。 enterprises.name "それは" enterprise.nameとしての名前 "でなければなりません –