title: AngularJS select integer value with HTML select tag
body: <p>I'm new to AngularJS. I have a very simple task: select an integer value with angular using an HTML <code>&lt;select&gt;</code> tag.</p>
  
  <pre><code>&lt;select ng-model="foo.bar"&gt;
      &lt;option ng-repeat="option in options" value="{{option}}"&gt;{{option}}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><code>foo.bar</code> holds an integer value. When I run the above code, the first generated option is: <code>&lt;option value="? number:32 ?"&gt;&lt;/option&gt;</code>. I have found out that the selected value is interpreted as a String. I want an Integer.</p>
  
  <p>I have found some possible solutions, but they are either complex (like the <a href="https://docs.angularjs.org/api/ng/directive/select#binding-select-to-a-non-string-value-via-ngmodel-parsing-formatting" rel="nofollow">documentation example to implement a <code>convert-to-number</code>-function</a>) , or their <code>options</code> array looks different (mine is just a simple array of integers).</p>