Skip to content

Commit 36c666b

Browse files
committed
fixed min value attribute bug
1 parent 549d957 commit 36c666b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

dist/angular-input-types.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/number.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ angular.module('inputTypes')
7676
}
7777

7878
var attrMin = scope.$eval(attrs.min);
79-
var minValue = attrMin !== undefined ? attrMin : 0;
8079

8180
ctrl.$parsers.unshift(function(viewValue) {
8281
if(!viewValue) {
@@ -98,7 +97,7 @@ angular.module('inputTypes')
9897
}
9998

10099
ctrl.$validators.min = function(modelValue, viewValue) {
101-
return ctrl.$isEmpty(modelValue) || modelValue >= minValue;
100+
return ctrl.$isEmpty(modelValue) || attrMin === undefined || modelValue >= attrMin;
102101
}
103102

104103
return modelValue === null ? null : modelValue.replace(decimalSeparator, '.').replace(/\.$/, '');

0 commit comments

Comments
 (0)