2016-02-04 48 views
2

我有一個多個UI選擇部件,我需要通過單擊更新按鈕來更新選擇。如何避免多個角度UI中的重複選擇

<ui-select multiple ng-model="multipleDemo.selectedPeople" theme="select2" ng-disabled="disabled" style="width: 800px;"> 
    <ui-select-match placeholder="Select person...">{{$item.name}} &lt;{{$item.email}}&gt;</ui-select-match> 
    <ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}"> 
     <div ng-bind-html="person.name | highlight: $select.search"></div> 
      {{person.email}} 
    </ui-select-choices> 
</ui-select> 

如果我使用字符串數組的變量它工作正常。但是當我使用對象數組時,重複出現在選項中。這裏是片段http://plnkr.co/edit/Jbhv1stbXEdNnt3of5aW?p=preview我如何避免與對象重複?請幫助。

回答