From 4b653aeac1aca7ac551738870a2446b6810ca0df Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Sun, 20 Oct 2013 20:07:50 -0700 Subject: fix(input): keep track of min/max attars on-the-fly Now input[type=button] keeps track of both min and max attrs even if they change over time. --- src/ng/directive/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ng/directive/input.js') diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 07b5f997..6e4961f8 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -544,8 +544,8 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { }); if (attr.min) { - var min = parseFloat(attr.min); var minValidator = function(value) { + var min = parseFloat(attr.min); if (!ctrl.$isEmpty(value) && value < min) { ctrl.$setValidity('min', false); return undefined; @@ -560,8 +560,8 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { } if (attr.max) { - var max = parseFloat(attr.max); var maxValidator = function(value) { + var max = parseFloat(attr.max); if (!ctrl.$isEmpty(value) && value > max) { ctrl.$setValidity('max', false); return undefined; -- cgit v1.2.3