Skip to content

Commit 64d2a1d

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

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
@@ -994,12 +994,9 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
994994
regexp = regex || undefined;
995995
});
996996

997-
var patternValidator = function(value) {
998-
return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value), value);
997+
ctrl.$validators.pattern = function(value) {
998+
return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);
999999
};
1000-
1001-
ctrl.$formatters.push(patternValidator);
1002-
ctrl.$parsers.push(patternValidator);
10031000
}
10041001

10051002
// min length validator

0 commit comments

Comments
 (0)