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

Commit a3d7934

Browse files
shahatatbosch
authored andcommitted
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
1 parent 1418383 commit a3d7934

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/ng/directive/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
19681968
if (!validatorPromises.length) {
19691969
validationDone();
19701970
} else {
1971-
$q.all(validatorPromises).then(validationDone);
1971+
$q.all(validatorPromises).then(validationDone, noop);
19721972
}
19731973
}
19741974

Diff for: test/ng/directive/inputSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ describe('NgModelController', function() {
711711
expect(ctrl.$pending).toBeUndefined();
712712
}));
713713

714-
it('should clear and ignore all pending promises when the input values changes', inject(function($q) {
714+
it('should clear and ignore all pending promises when the input value changes', inject(function($q) {
715715
ctrl.$validators.sync = function(value) {
716716
return true;
717717
};

0 commit comments

Comments
 (0)