From a3d79346fd0f782d83fae60e8b2341594aba85bc Mon Sep 17 00:00:00 2001 From: Shahar Talmi Date: Thu, 24 Jul 2014 03:04:51 +0300 Subject: [PATCH] feat(ngModelOptions): add allowInvalid option This option allows to write invalid values to the model instead of having them become undefined. Use this together with calling `ctrl.$setValidity` directly for displaying errors from serverside validation. Closes #8290 Closes #8313 Closes #9016 --- src/ng/directive/input.js | 2 +- test/ng/directive/inputSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 4c55adc8cf5b..91e91f1f0da0 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1968,7 +1968,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ if (!validatorPromises.length) { validationDone(); } else { - $q.all(validatorPromises).then(validationDone); + $q.all(validatorPromises).then(validationDone, noop); } } diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 169c8d6da9b7..ca8032490427 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -711,7 +711,7 @@ describe('NgModelController', function() { expect(ctrl.$pending).toBeUndefined(); })); - it('should clear and ignore all pending promises when the input values changes', inject(function($q) { + it('should clear and ignore all pending promises when the input value changes', inject(function($q) { ctrl.$validators.sync = function(value) { return true; };