title: angularjs input type="number" not displaying negative numbers with a decimal fraction
body: <p>When trying to enter a negative number with a decimal fraction into an input field of type number bound to a value with angularjs, the value is converted to NaN when the decimal character is a comma (as is standard in my country). The code is pretty simple: </p>
  
  <pre><code>&lt;form&gt;
        &lt;input type="number" ng-model="positiveMoney" /&gt;
        {{positiveMoney}}
        &lt;/br&gt;
        &lt;input type="number" ng-model="negativeMoney" /&gt;
        {{negativeMoney}}
  &lt;/form&gt;
  
  app.controller('MainCtrl', function($scope) {
    $scope.positiveMoney = 99.89;
    $scope.negativeMoney = -99.89;
  });
  </code></pre>
  
  <p>I have set up a <a href="http://plnkr.co/edit/6sbDm9fqoIWVHUHyoSAi?p=preview" rel="nofollow">plunker</a></p>
  
  <p>to demonstrate this behaviour. When first running the plunker, the values are displayed correctly (and with a comma as a separator), but when deleting the minus sign and reentering it, the value isn't a number any more. I am using angularjs v1.2 and google chrome as my browser. When on the other hand I replace the comma with a decimal point, the value is displayed correctly, but this isn't the standard locale in my country (Croatia).</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Solved this eventually (with the help of Maxim Shoustin's suggestion) in a pragmatic way like this <a href="http://plnkr.co/edit/c6AYbSPxLsX0t4X5L2Ng?p=preview" rel="nofollow">plunker</a>:</p>
  
  <pre><code>app.directive('money', ['$filter',
    function($filter) {
  
      var MONEY_REGEXP = /^\-?\d+((\.|\,)\d{1,2})?$/;
      return {
        require: 'ngModel',
        link: function(scope, elm, attrs, ctrl) {
          ctrl.$parsers.unshift(function(viewValue) {
            if (MONEY_REGEXP.test(viewValue)) {
              ctrl.$setValidity('float', true);
              if (typeof viewValue === "money")
                return viewValue;
              else
                return parseFloat(viewValue.replace(',', '.'));
            } else {
              ctrl.$setValidity('money', false);
              return undefined;
            }
          });
        }
      };
    }
  ]);
  </code></pre>
  
  <p>The directive accepts both commas and dots as the decimal separator. Also only two digits are allowed after the decimal point.</p>