I have the json object that is returned from an ajax call:
0: Object
id: "0-0-0"
selected: "selected"
text: "option name"
value: 0
__proto__: Object
1: Object
id: "12-0-0"
selected: ""
text: "4C 1.75 16v Tbi ( TCT )"
value: 59885
I want to populate the options of a select like so:
<option value="0" id="0-0-0" selected="selected">option name </option>
How is this possible with ng-options?
selectfor a single option.ng-repeatcreates a new scope for each iteration, song-optionsis the more efficient choice, but it sounds like in your case you need to use it, and unless you're outputting many, many options, it shouldn't be a problem.