1

是否可以在ng-select多项选择中隐藏一些 SELECTED 项?

我与包括我自己在内的多个用户一起创建活动。我想将自己留在模型列表中,但我不想在 ui-select-match 中显示自己。

我试过使用ng-hideon ui-select-match,但没有成功。

<ui-select multiple ng-model="event.users" theme="bootstrap">
   <ui-select-match placeholder="Select users...">{$ $item.username $}</ui-select-match>
   <ui-select-choices repeat="user in users">
      <div ng-bind-html="user.username" ng-show="user.id != auth.id"></div>
   </ui-select-choices>
</ui-select>
4

1 回答 1

2

我不知道你如何隐藏它,但你可以禁止删除自己:

ui-lock-choice="$item.id == auth.id"

JSFiddle 上的演示

于 2017-01-27T13:22:43.663 回答