Here is the code for my dropdown selection:
<select class="form-control form-controls input-sm" ng-model="vm.retailer.state" ng-options="state.code as state.name for state in vm.states" required>
<option value="">-- Select a State --</option>
</select>
Below is the information for the first state in the dataset:
"State": [
{
"code": "AL",
"name": "Alabama"
},
The HTML output displays as follows:
<select class="form-control form-controls input-sm ng-pristine ng-invalid ng-invalid-required ng-touched" ng-model="vm.retailer.state" ng-options="state.code as state.name for state in vm.states" required="">
<option value="" class="">-- Select a State --</option>
<option value="0" label="Alabama">Alabama</option>
...
</select>
I have searched through various posts with similar problems, but none of the solutions seem to work for me. The data being loaded into the view contains both Code and Name elements as expected.