I cannot get ng-options to work:
My model that I'd like to update via a drop down is
wifiSettings = { channelNumber: 2, ... }
and the available options should come from an array like
availableChannels = [
{
number: 1,
frequency: 2412,
maxTransmitPower: 20
},
{
number: 2,
frequency: 2417,
maxTransmitPower: 20
},
....
]
I tried with several expressions in ng-options, but nothing seemed to work, for example, this does never show the selected value:
<select id="channel"
ng-model="wifiSettings.channelNumber"
ng-options="channel.number as channel.number for channel in availableChannels track by channel.number">
</select>
(Ideally the labels in the options should be an expression like "{{ channel.number + '(' + channel.frequency + 'MHz)' }}" but that's another story.)
Here is a (broken) example:
http://plnkr.co/edit/4e28Pe?p=info