diff options
| author | Dmitry Shirokov | 2013-10-20 20:07:50 -0700 |
|---|---|---|
| committer | Matias Niemelä | 2013-10-24 09:19:55 -0400 |
| commit | 4b653aeac1aca7ac551738870a2446b6810ca0df (patch) | |
| tree | 68b1ad607e2488ce440b1184480312b8cfb7afd3 /src/ng/directive/input.js | |
| parent | 269bc7e51f0ae4e4230308e43db934a9fff48756 (diff) | |
| download | angular.js-4b653aeac1aca7ac551738870a2446b6810ca0df.tar.bz2 | |
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.
Diffstat (limited to 'src/ng/directive/input.js')
| -rw-r--r-- | src/ng/directive/input.js | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
