I have a ng-options
list defined with a HTML select element such as:
<select
required="required"
ng-model="vm.selectedOption"
ng-options="item.name as item.label for item in vm.options">
<option value="">Select an option</option>
</select>
This however results in the following HTML:
<option value="string:VALUE" label="Option Name">Option Name</option>
I am using Angular version 1.4.8, does anyone have a solution how to solve the string:
issue or at least can explain to me why this is occurring?
The vm.options
array looks like this:
[
{
"name": "INFILL_AUTOMATIC",
"label": "Automatic"
},
{
"name": "INFILL_GRID",
"label": "Grid"
}
]
//EDIT:
When logging vm.selectedOption
I just see the correct value. So the ng-model
does in fact have the correct value. But why is Angular giving the default value
then this prefix, is it using this prefix to define the "type" for the ng-model
or something?