title: Validate <input type="number" /> with AngularJS and Pattern/RegEx
body: <p>I have a input of type number, and I want to make sure it only accepts a number. I can do this fine on the Server side, but with AngularJS I can not get it to work.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;input type="number" ng-pattern="/[0-9]+/" name="numOfFruits" ng-model="basket.numOfFruits" /&gt;
  </code></pre>
  
  <p>I suspect this has something to do with the pattern I am supplying <code>[0-9]+</code> basically I only want numbers in this text box, anything that is not made up of the numbers 0 to 9, I want the input invalid.</p>
  
  <p>At the moment, my input field sees this <code>aa23423</code> as valid input!</p>