Mpondomise Mpondomise - 1 year ago 126
AngularJS Question

angular ui-select not loading big list in dropdown

Here is my json file of the cities of the world: google drive link.

and here is my html code:

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

why the list of some countries is not loading? is the problem with the json file? or is it because some countries have a big list of cities? is it because it surpasses the ui-select limit?
some countries load the list, and some doesn't, it is empty.

Answer Source

you have to limit the view to a small number to have a good performance, like | limitTo: 10:

<ui-select-choices repeat="r in selectedcity | filter: $ | limitTo: 10">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download