ng-options with simple array init

I’m a little bit confused with Angular and ng-options. I have a simple array and I want to init a select with it. But, I want that options value = label. script.js $scope.options = [‘var1’, ‘var2’, ‘var3’]; html <select ng-model=”myselect” ng-options=”o for o in options”></select> What I get: <option value=”0″>var1</option> <option value=”1″>var2</option> <option value=”2″>var3</option> What … Read more

Working with select using AngularJS’s ng-options

I have read about it in other posts, but I couldn’t figure it out. I have an array, $scope.items = [ {ID: ‘000001’, Title: ‘Chicago’}, {ID: ‘000002’, Title: ‘New York’}, {ID: ‘000003’, Title: ‘Washington’}, ]; I want to render it as: <select> <option value=”000001″>Chicago</option> <option value=”000002″>New York</option> <option value=”000003″>Washington</option> </select> And also I want to … Read more