title: Ng-keypress prevent default for specific charCode
body: <p>I have an input that is type="number". I want to prevent the user from typing decimals, addition, subtraction, or e into the input. Currently I am trying to e.preventDefault() on ng-keypress to disable the key completely. But it is not working. I am using typescript and angularJs. It is seeing the event on keypress but it is not preventing the entry from being made. Or, would using ng-pattern with a regex be an alternative option retrict input to 0-9?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>setCapacityType(e) {
    let keyCode = (e.keyCode ? e.keyCode : e.which);
    
    if (keyCode &lt; 48 &amp;&amp; keyCode &gt; 57) {
      e.preventDefault();
      console.log("xx");
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="number" ng-keydown="vm.setCapacityType($event)"
  autocomplete="off" autocorrect="off" spellcheck="false"&gt;</code></pre>
  </div>
  </div>
  </p>