我使用了uib-typeahead指令,如下所示:
<input type="text" id="search-box" class="form-control" data-ng-model="searchBar.search.searchString"
typeahead-on-select="searchBar.gotoPartDetails($item, $model, $label, $event)" uib-typeahead="result as result.partNumber+' '+result.lineDesc+' '+result.partDesc for result in searchBar.textTyped($viewValue)"
placeholder="Search by part number, product type, product line, keyword" typeahead-focus-first="searchBar.search.firstSelect" typeahead-popup-template-url="app/components/header/search-bar/typeahead-popup.html" typeahead-template-url="{{searchBar.search.typeaheadTemplate}}"
data-ng-focus="searchBar.focus()" data-ng-blur="searchBar.blur()">
我基本上使用&#34; searchBar.search.firstSelect
&#34;范围变量,用于启用或禁用第一个选择。在控制器上,负载searchBar.search.firstSelect
设置为false,并且基于显示的长度数据的大小。如果预先输入只显示选项中的一个数据,我将searchBar.search.firstSelect
设置为true。但这并没有反映在UI中。我该怎么办?