2016-11-12 31 views
1

這裏是我的世界城市的json文件:google drive link角度ui-選擇不在下拉列表中加載大列表

這裏是我的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的限制嗎?有些國家加載了這個列表,有些沒有,它是空的。

+0

能否請您提供的jsfiddle https://jsfiddle.net與您的代碼。謝謝。 – tomepejo

回答

3

您必須將視圖限制爲少數有不錯的表現,就像| limitTo: 10

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