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

Commit

Permalink
feat(ngModelOptions): add allowInvalid option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shahata authored and tbosch committed Sep 10, 2014
1 parent 1418383 commit a3d7934
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit a3d7934

Please sign in to comment.