prd*_*uty 1 angularjs bootstrap-typeahead angular-ui-bootstrap
嗨我在我的angularjs网站使用bootstrap ui typeahead.这非常有效.只是想知道当用户输入不在列表中的内容时是否可以显示"找不到匹配项"等文本.
typeahead指令包含一个属性,typeahead-no-results.
这是一个例子:
<input type="text" ng-model="asyncSelected" placeholder="Placeholder Text" typeahead="address for address in getLocation($viewValue)" typeahead-no-results="noResults" class="form-control">
Run Code Online (Sandbox Code Playgroud)
然后使用ng-if或ng-show显示错误消息.
<div ng-if="noResults">
No Results Found!
</div>
Run Code Online (Sandbox Code Playgroud)
有关更多阅读材料,请务必查看bootstrap-ui文档
| 归档时间: |
|
| 查看次数: |
8364 次 |
| 最近记录: |