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

Commit e63d425

Browse files
committed
fix(NgModel): make sure the pattern validator uses the $validators pipeline
1 parent e53554a commit e63d425

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/ng/directive/input.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,9 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
996996
regexp = regex || undefined;
997997
});
998998

999-
var patternValidator = function(value) {
1000-
return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value), value);
999+
ctrl.$validators.pattern = function(value) {
1000+
return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);
10011001
};
1002-
1003-
ctrl.$formatters.push(patternValidator);
1004-
ctrl.$parsers.push(patternValidator);
10051002
}
10061003

10071004
// min length validator

0 commit comments

Comments
 (0)