[英]Angular UI bootstrap - show dropdown on typeahead-no-results
嘗試在沒有結果的情況下得到一個下拉菜單,但下拉菜單不顯示視圖
<div class="dropdown">
<div class="form-group">
<input placeholder="Vælg kunde" type="text" ng-model="customer" typeahead-editable="false" uib-typeahead="customer as customer.customer for customer in customers | filter:$viewValue | limitTo:8" class="form-control"
typeahead-popup-template-url="customPopupTemplate.html"
typeahead-min-length="0"
typeahead-no-results="noResults">
</div>
<div ng-if="noResults" dropdown-toggle>
<ul class="dropdown-menu" >
<li><a href="#">No result</a></li>
</ul>
</div>
</div>
刪除class =“dropdown-menu”給了我沒有結果的li,但是我不把它作為下拉菜單
誰沒有結果我切換這個下拉菜單?
問題是下拉永遠不會被觸發,並且沒有正確呈現。 你只是讓標記可見。
您可以設置auto-close="disabled"
和is-open="true"
以在noResults
正確顯示下拉列表:
<div class="form-group">
<input placeholder="Vælg kunde" type="text" ng-model="customer" typeahead-editable="false" uib-typeahead="state for state in states | filter:$viewValue | limitTo:8" class="form-control" typeahead-min-length="0" typeahead-no-results="noResults">
<span ng-if="noResults" auto-close="disabled" is-open="true" uib-dropdown uib-dropdown-toggle>
<ul class="uib-dropdown-menu" >
<li><a href>no results</a></li>
</ul>
</span>
</div>
工作演示 - > http://plnkr.co/edit/4vVznXyjZo3HuIb2p5as?p=preview
注意 :plnkr使用的是ui-bootstrap版本0.14.3,如果您使用的是0.14.0之前的版本,則不要附加uib-
前綴。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.