Filter members exclude the first select
In my app I am using angular ui-select displaying a list of members (array of objects).
It is working fine except one little issue:
I need take off the first ui-select (members in a team) of the second (extra members outside of a team)
SITUATION:
I create a edit form to edit a project. When i select a team the members load in members select.
Also i want to add extra members outside the team. I want to exclude the team members from the extra members list I try the next
filter: {id:'!'+selectedTeam.selected.members} | filter: $select.search track by member.id"
Also try other filters examples in skacoverflow but i can't do it, i wasted 5 hours in this
I create one example in
PLUNKER: http://plnkr.co/edit/HrKB046xNrJtZinyNYVN.
CODE:
<div class="form-group">
<label >Extra members</label>
<ui-select multiple ng-model="test" theme="bootstrap" ng-disabled="" >
<ui-select-match placeholder="Select person...">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="member in members | filter: {id:'!'+selectedTeam.selected.members} | filter: $select.search track by member.id">
<div ng-bind-html="member.name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
QUESTION:
How can take off the first select from the second?
Hi, I think there is no single expression to handle your requirement. Creating a custom filter will help.
Please check this plunker fork.
http://plnkr.co/edit/KnXaI4CL2r4qsgYvph9E
Please ignore if i misunderstood your question.
Closing as answered.