Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(input:number): min/max not work when binded variable initial as false value #10711

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ng/directive/input.js
Original file line number Diff line number Diff line change
@@ -1228,7 +1228,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
return value;
});

if (attr.min || attr.ngMin) {
if (isDefined(attr.min) || attr.ngMin) {
var minVal;
ctrl.$validators.min = function(value) {
return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
@@ -1244,7 +1244,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
});
}

if (attr.max || attr.ngMax) {
if (isDefined(attr.max) || attr.ngMax) {
var maxVal;
ctrl.$validators.max = function(value) {
return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;