我有以下代码。我想在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"}
];
我要在$scope.designationList = [
{name:"Debtor", id:"1"},
{name:"Secured Party", id:"2"}
];
中看到一个选定的值