I have array with object:
[
...
{
id: 1,
name: 'Value',
desc: 'Test'
}
...
]
How i can generate option by ng-options with text Value (Test)
?
You could use:
<select
ng-model="selectedOption"
ng-options="o.id as o.name + ' (' + o.desc + ')' for o in options">
</select>
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With