I'm using an object for my ng-options
:
$scope.data = {
option1 : 1,
option2 : 1,
option3 : 1,
option4 : 2
};
Notice that options 1-3 has the same value 1
Using this select
element with the ng-options
directive
<select ng-model=combo_value
ng-change='set_value()'
ng-options="k for (k,v) in data">
</select>
I'm unable to select options 1 and 2.
Even weirder is that using the keyboard i can select options 1 & 2 but when selecting with the mouse, the select is automatically jumping to option 3 (guessing that it's because it's the last option with the value 1
).
I tried different ng-options
expression but none seem to work
v as k for (k,v) in data
k for (k,v) in data track by $index
k for (k,v) in data track by k
note : k
is always unique