我需要在db中保存数据后显示下拉列表的选定值。 下面是我的代码。
<table>
<tr ng-repeat="customer in user.customers track by $index">
<td class="tableTd" ng-show="customer.quoteApprovalLevels">{{customer.ic01}} ({{customer.customerName}})</td>
<td class="tableTd" ng-show="customer.quoteApprovalLevels">
<select ng-model="user.customers[$index].userQuoteApprovalLevel.approvalLevel">
<option ng-repeat="approvalLevel in customer.quoteApprovalLevels" value="{{approvalLevel.approvalLevel}}">
{{approvalLevel.approvalLabel}} - {{approvalLevel.approvalLevel}}
</option>
</select>
</tr>
</table>
js代码是
$scope.user = Administration.save($scope.user, function (data, httpResponse)
{
}
答案 0 :(得分:0)
<table>
<tr ng-repeat="customer in user.customers track by $index">
<td class="tableTd" ng-show="user.customers[$index].userQuoteApprovalLevel.approvalLevel">{{customer.ic01}} ({{customer.customerName}})</td>
<td class="tableTd" ng-show="customer.quoteApprovalLevels">
<select ng-model="user.customers[$index].userQuoteApprovalLevel.approvalLevel">
<option ng-repeat="approvalLevel in customer.quoteApprovalLevels" value="{{approvalLevel.approvalLevel}}">
{{approvalLevel.approvalLabel}} - {{approvalLevel.approvalLevel}}
</option>
</select>
</tr>
</table>