这是我的对象
$scope.status = [{
"code": "CNA",
"name": "Consignee Not Available"
}, {
"code": "TBD",
"name": "To Be Delivered"
}, {
"code": "CRA",
"name": "Consignee Refused To Accept"
}, {
"code": "D",
"name": "Delivered"
} ]
我的HTML如下
<select ng-options="status.name for status in status" ng-model="awb.delivery_fail_reason">
<option value="">Please Select Status</option>
</select>
所以我想要的是
- 当用户选择状态时,
To be Delivered
我的模型变量awb.delivery_fail_reason
应设置为TBD
awb.delivery_fail_reason
什么时候模型TBD
应该自动将选择设置为To Be Delivered
这可能吗?