diff options
| author | Vojta Jina | 2012-03-12 01:24:43 -0700 |
|---|---|---|
| committer | Vojta Jina | 2012-03-12 01:40:12 -0700 |
| commit | 1b9277bf6f16f714bba418dd5a7bf719206fe4d6 (patch) | |
| tree | 81c527a4401504fbdba4c87b9db3ea4ebcdceb65 /src/directive | |
| parent | cce31d4c93978a9b2ed3bddb5f16e22fa0d07f5b (diff) | |
| download | angular.js-1b9277bf6f16f714bba418dd5a7bf719206fe4d6.tar.bz2 | |
fix(forms): Propagate change from model even if it's undefined
Diffstat (limited to 'src/directive')
| -rw-r--r-- | src/directive/input.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/directive/input.js b/src/directive/input.js index 1a3acd01..7b95baaf 100644 --- a/src/directive/input.js +++ b/src/directive/input.js @@ -847,7 +847,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', 'ngModel', value = formatters[idx](value); } - if (isDefined(value) && ctrl.viewValue !== value) { + if (ctrl.viewValue !== value) { ctrl.viewValue = value; ctrl.render(); } @@ -1042,7 +1042,7 @@ var requiredDirective = [function() { if (!ctrl) return; var validator = function(value) { - if (attr.required && isEmpty(value)) { + if (attr.required && (isEmpty(value) || value === false)) { ctrl.setValidity('REQUIRED', false); return null; } else { |
