This is my object
$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"
} ]
my HTML is as follows
<select ng-options="status.name for status in status" ng-model="awb.delivery_fail_reason">
<option value="">Please Select Status</option>
</select>
so what I want is
- when user selects the status
To be Delivered
my model variableawb.delivery_fail_reason
should be set toTBD
- when model
awb.delivery_fail_reason
isTBD
it should automatically set select toTo Be Delivered
Is this possible ?
status.code as status.name for status in status