簡體   English   中英

angular ui-select不在下拉列表中加載大列表

[英]angular ui-select not loading big list in dropdown

這是我的世界城市的json文件: 谷歌驅動器鏈接

這是我的HTML代碼:

<div class="form-group">
    <label class="control-label">
        CITY
    </label>
    <ui-select name="city" ng-model="myModel.city" theme="selectize" >
        <ui-select-match placeholder="{{ 'placeholders.project.city' | translate }}">
            {{$select.selected}}
        </ui-select-match>
        <ui-select-choices repeat="r in selectedcity | filter: $select.search">
            <div ng-bind-html="r | highlight: $select.search"></div>
        </ui-select-choices>
    </ui-select>
</div>

為什么一些國家的名單沒有加載? 是json文件的問題? 還是因為有些國家有很多城市? 是因為它超過了ui-select限制? 一些國家加載列表,有些國家沒有,它是空的。

您必須將視圖限制為較小的數字以獲得良好的性能,例如| limitTo: 10 | limitTo: 10

<ui-select-choices repeat="r in selectedcity | filter: $select.search | limitTo: 10">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM