From 8355b4c894565451ff47974384bdb05b4a9dab77 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 16 Mar 2015 16:36:31 +0100 Subject: [PATCH] possible solution for #11157 * https://github.com/angular/angular.js/issues/11157 --- src/ng/directive/input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index e59ae067582d..8ef496ddda4b 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1241,7 +1241,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { ctrl.$formatters.push(function(value) { if (!ctrl.$isEmpty(value)) { - if (!isNumber(value)) { + if (isNaN(parseFloat(value)) || !isFinite(value)) { throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); } value = value.toString();