繁体   English   中英

Angular JS-如何停止从多个表中重复相同的选定下拉数据

[英]Angular JS - How do I stop repeating same selected dropdown data from multiple table

我是Angular的新手,正在尝试创建表列表,每个表将负责显示对象的数据。 但是,当我尝试从表的下拉列表中选择某项时...相同的数据将被另一个表的另一个下拉列表选择。

<div ng-repeat="appl in applMasterList">
   <h4>{{appl.Name}}</h4>
   <div class="table-responsive">
       <table class="table table-striped table-bordered" style="margin-bottom: 0">
           <tr>           
               <th>
                   Responsible Person
               </th>
           </tr>
           <tr ng-repeat="list in appl.standardApplications">         
               <td>
                   <div class="form-group">
                       <ui-select class="form-control" id="contact" g-required="Required" multiple ng-model="select[$index]" theme="bootstrap" ng-disabled="ctrl.disabled" close-on-select="true" title="Select Responsible Person" >
                           <ui-select-match placeholder="Select Responsible Person..." ng-required="Required">{{$item.DisplayName}}</ui-select-match>
                           <ui-select-choices repeat="contactDetail in contactlist | filter:$select.search">
                               {{contactDetail.DisplayName}}
                           </ui-select-choices>
                       </ui-select>
                   </div>
               </td>              
           </tr>
       </table>
   </div>
   <br />
</div>

app.controller('StdController', function ($scope) {

  $scope.select = [];

});

我敢肯定我做错了事,但是由于缺乏Angular的经验,所以我无法在这里找到问题所在。 非常感谢您的帮助。 谢谢。

在此处输入图片说明

使用选项track by

ui-select-choices repeat="contactDetail in contactlist track by contactDetail.id | filter:$select.search"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM