我使用的是angularjs-bootstrap-ui插件找到的here。这是我的html
<input type="text" ng-model="asyncSelected" typeahead-loading="loadingPeople" typeahead-min-length="3" placeholder="Search People" typeahead="person for person in findPeople($viewValue)" class="form-control typeahead-input" />这很好用,但是它说它是基于bootstrap api构建的,看看this,应该有一种方法使用“提示”作为参数,这样当你键入它时,它就会显示为灰色提示。这是不是根本不在angular bootstrap ui api中?
发布于 2017-07-29 05:51:47
要让Typeahead的提示功能与angular-ui的Typeahead指令协同工作,只需向input元素添加typeahead-show-hint="true"属性。例如:
<input
type="text"
class="myClass"
ng-model="selected"
uib-typeahead="item for item in vm.states | filter:$viewValue | limitTo:8"
placeholder="State"
typeahead-show-hint="true"
/>https://stackoverflow.com/questions/24495825
复制相似问题