AngularJS: HTML select, use values ββfrom map
This HTML has:
<select ng-model="group" ng-options="g.key for g in groups"></select>
Although $scope.groupsthere is a map {'a':'', 'b':'', 'c':''}
I would like to display the map keys: a, b, c
Currently, he does not choose anything. How to change ng-options? \
UPDATE 1
g for g in Object.keys(groups) doesn't work either.
You can use this syntax:
<select ng-model="group" ng-options="key for (key, g) in groups"></select>
You can check the full documentation for the directive select, especially the details of ngOptions: http://docs.angularjs.org/api/ng.directive:select