【发布时间】:2014-03-17 12:48:20
【问题描述】:
我已经在我正在编写的一个小型 angularjs 应用程序中添加了 angular-typeahead,代码基于我下载的 angularjs-example 构建。我在控制器中定义了一个数组,可以在视图中选择一个项目。我在 app.js 的 angular.module 中添加了 ui.bootstrap。
participants.js:
$scope.clubs = ['BBIL', 'STIL', 'Vikane IL'];
participants.html:
<div class="form-group">
<input type="text" class="form-control" placeholder="Club" ng-model="participant.club" typeahead="club for club in clubs | filter:$viewValue">
</div>
当我选择一个项目时,它会添加到文本框中,但下拉菜单不包含任何文本。如何在下拉列表中显示可用项目?可能有一些 css 魔法可以应用。
问候 克劳斯
【问题讨论】:
标签: angularjs bootstrap-typeahead