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

时间:2016-11-12 12:34:46

标签: javascript angularjs json ui-select angular-ui-select

以下是我所在城市的json文件:google drive link

这是我的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限制? 有些国家加载了清单,有些国家没有,它是空的。

1 个答案:

答案 0 :(得分:3)

您必须将视图限制为较小的数字才能获得良好的效果,例如Intent intent = getIntent(); String myText = intent.getExtras().getString(getString(R.string.EXTRA_STUFF));

| limitTo: 10