【发布时间】:2016-01-10 11:06:50
【问题描述】:
我有一个包含 10,000 个对象的数组,每次单击选择时都会导致浏览器崩溃。有没有办法限制ui-select 一次只在屏幕上显示 10 个?另外,我使用的库是ui-select。
<ui-select ng-model="ed.main.user.UserID.selected" theme="bootstrap">
<ui-select-match placeholder="{{main.editTicket.UserDisplayName}}">
{{$select.selected.DisplayName}}
</ui-select-match>
<ui-select-choices repeat="t in main.users |filter:$select.search"value="{{$selected.UserID}}">
<div ng-bind-html="t.DisplayName | highlight: $select.search"></div>
<small ng-bind-html="t.UserID | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
【问题讨论】:
-
第一件事,你不应该将 10,000 个对象绑定到你的
ui-select,它可能会挂起你的浏览器..当用户输入输入时,你应该懒惰地使用这些选项 -
这不是一个有角度的 ui 引导问题。
标签: javascript html angularjs angularjs-directive angular-ui