title: Directive restricting input is not working with type=number
body: <p>I have a custom directive that restricts input to specific symbols, in my case, only numbers. It is made after <a href="https://stackoverflow.com/questions/14419651/angularjs-filters-on-ng-model-in-an-input/14425022#14425022">filters on ng-model in an input</a> and it works fine in text-type inpit.</p>
  
  <p>Directive declared as</p>
  
  <pre><code>     .directive('onlydigitinput', function () {
      return {
          require: 'ngModel',
          link: function (scope, element, attrs, modelCtrl) {
              modelCtrl.$parsers.push(function (inputValue) {
                  var transformedInput = inputValue.toLowerCase().replace(/ /g, '').replace(/[^0-9]+/g, '');
                  if (transformedInput != inputValue) {
                      modelCtrl.$setViewValue(transformedInput);
                      modelCtrl.$render();
                  }
                  return transformedInput;
              });
          }
      };
  })
  </code></pre>
  
  <p>but in case of numerical input I want to use input type=number, not type=text:</p>
  
  <pre><code>&lt;input type="number"  
  onlydigitinput="onlydigitinput" required="required" min="1" max="99" maxlength="2"&gt;
  </code></pre>
  
  <p>and then it's a problem: I have correct validation based on min-max attribute, but I still can enter all symbols, such as letters, and directive does not work as it should. Additionally, maxlength seems not to have effect. How I can possibly fix my directive to work with type="number" inputs?</p>