typeahead bootstrap显示下拉列表但没有li标签

时间:2014-12-26 10:35:22

标签: angularjs bootstrap-typeahead

我正在使用angularjs和bootstrap。我的一些页面与" typeahead"代码。

当我在文本字段中写入字符时,下拉列表会显示但标签为空。

当我点击任何空标签时,它会用正确的值填充文本字段。

问题是,下拉列表不显示标签

任何解决方案。

<input type="text" class="order_input" ng-model="selected_address" 
  typeahead="rest as rest.name for rest in  searchTerms($viewValue,'restaurants/typeahead_address/',{type:restaurant_type})" 
   placeholder="Enter Postal Code or Address.." /> 

1 个答案:

答案 0 :(得分:0)

我不确定typeahead 但我实际应用你正在谈论的内容如下

<input type="text" class="order_input" list="dataSource" placeholder="Enter Postal Code or Address.." />
    <datalist id="dataSource" >
        <option ng-repeat="rest in allData">{{rest.name}}</option>            
    </datalist>