Skip to content

Commit 8355b4c

Browse files
author
Martin
committed
possible solution for angular#11157
* angular#11157
1 parent d8492f4 commit 8355b4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/directive/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
12411241

12421242
ctrl.$formatters.push(function(value) {
12431243
if (!ctrl.$isEmpty(value)) {
1244-
if (!isNumber(value)) {
1244+
if (isNaN(parseFloat(value)) || !isFinite(value)) {
12451245
throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);
12461246
}
12471247
value = value.toString();

0 commit comments

Comments
 (0)