Q:

AngularJS select integer value with HTML select tag

I'm new to AngularJS. I have a very simple task: select an integer value with angular using an HTML <select> tag.
<select ng-model="foo.bar">
    <option ng-repeat="option in options" value="{{option}}">{{option}}</option>
</select>

foo.bar holds an integer value. When I run the above code, the first generated option is: <option value="? number:32 ?"></option>. I have found out that the selected value is interpreted as a String. I want an Integer.
I have found some possible solutions, but they are either complex (like the documentation example to implement a convert-to-number-function) , or their options array looks different (mine is just a simple array of integers).

A:

Instead of the option tag combined with ng-repeat you should use angulars ng-options directive like this:
<select ng-model="foo.bar" ng-options="option for option in options"></select>

If options is an array of integers, ng-model should contain an integer as well.

