Reputation: 260
http://plnkr.co/edit/SxdjrBeUF48DrdFQuFHz?p=preview
I have a selected and I want to get the value only.
this is what I currently getting
{"_code":"AUD","description":"AUD - Australian Dollar"}
what I want to get
"AUD"
how can I accomplish this, below is my code.
<select ng-model="myModel"
ng-options="o.description for o in currencies track by o._code">
</select>
Note: I can't ng-repeat
my <option>
tag instead, because I am trying to edit object and I want it to be selected in the select tag.
Upvotes: 0
Views: 113
Reputation: 5387
ng-options="o._code as o.description for o in currencies"
Plunk: http://plnkr.co/edit/UZy39F4CwX8Ey8WryWVm?p=preview
Upvotes: 1