How could I get the key and the value too from an ng-options element, if I load the data from an object, not from an array?
HTML:
<select ng-model="select" ng-options="value for (key, value) in brand"></select>
<pre>{{select}}</pre>
<!-- {{select.key}}, {{select.value}} -->
Controller:
$scope.brand = {
'a': 'alpha',
'b': 'bravo',
'c': 'charlie',
'd': 'delta'
};
Thank in advance!