无法在ng-select中显示默认值

时间:2018-12-17 12:11:21

标签: angularjs

我有以下代码。我想在select-> infoData字段的selection中显示一个值,但是失败了。

<tbody>                 
    <tr ng-repeat="emp in infoData">
        <td>                              
            <input name="selection{{$index}}" ng-model="emp.name"  ng-disabled="!enabledEdit[{{$index}}]" />
        </td>
        <td>          
          <select name="name{{$index}}" ng-model="emp.selection" ng-options="employe.id as employe.name for employe in designationList" ng-disabled="!enabledEdit[{{$index}}]"></select>
        </td>
        <td>
            <input name="email{{$index}}" ng-model="emp.email"  ng-disabled="!enabledEdit[{{$index}}]"/>
        </td>                            
        <td >
          <div class="buttons" align="center">
            <button class="btn btn-sm btn-primary" ng-click="editEmployee($index)">Edit</button>
            <!--<button class="btn btn-sm btn-danger" ng-click="deleteEmployee($index)">Delete</button>-->
          </div>  
        </td>
      </tr>
</tbody>

如何在infoData的{​​{1}}中选择选择值?

select

$scope.infoData = [
        { name: $scope.applicant, selection: "Debtor", email:"a@gmail.com"},
        { name: $scope.secureParty, selection:"Secured Party", email:"b@gmail.com"}
    ];

enter image description here

我要在$scope.designationList = [ {name:"Debtor", id:"1"}, {name:"Secured Party", id:"2"} ]; 中看到一个选定的值

0 个答案:

没有答案