Below is my select with ng-options
:
<select ng-options="key as value for (key , value) in getList() ..."> </select>
The getList()
function retrieves the following object:
{"CURRENT_ACCOUNT":"test1","ORDINARY_ACCOUNT":"test2"}
and if I inspect the generated options, it is the following:
<option label="test1" value="string:CURRENT_ACCOUNT" selected="selected">test1</option>
As you can see, everything seems right except the value
attribute has a string:
prefix.
How can I remove the prefix? What did I do wrong?
#angular.js #forms