Struggling to set the default option in my ng-options/ng-model. Any advice?
The dropdown is populating correctly but the default option is missing, indicating an issue with ng-model implementation. Can anyone assist?
I'm using ng-repeat to iterate over an array within a table:
$scope.dumpsters = [
{id:"1", sub_customer: 'a'},
{id:"2", sub_customer: 'b'},
{id:"3", sub_customer: 'c'}
]
For simplicity, there's a separate array of sub_customers:
$scope.subCustomers = [{description:'a'}, {description:'b'}, {description:'c'}];
In each row of the table, there is a column containing this select element:
<select ng-model="d.sub_customer" ng-options="v.description for v in subCustomers" ng-change="updateCustomer(d.sub_customer, d.id)"></select>