Iterate with ng-options in a dictionary(object) [closed] Iterate with ng-options in a dictionary(object) [closed] angularjs angularjs

Iterate with ng-options in a dictionary(object) [closed]


For a model like this:

$scope.options = {    'optionName1': 'optionValue1',    'optionName2': 'optionValue2',    'optionName3': 'optionValue3',    'optionName4': 'optionValue4',};

You can create options like this:

<select ng-change="change()" ng-model="votes.status" ng-options="v for (k,v) in options"></select>