Skip to content

Commit e63d425

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

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/ng/directive/input.js

Lines changed: 2 additions & 5 deletions
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)