Skip to content

Commit 8b33d34

Browse files
committed
Set patternDirective validator to test against viewValue instead of
modelValue. Fixes angular#12344 & angular#12618.
1 parent dc48aad commit 8b33d34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ng/directive/validators.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ var patternDirective = function() {
4343
ctrl.$validate();
4444
});
4545

46-
ctrl.$validators.pattern = function(value) {
47-
return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);
46+
ctrl.$validators.pattern = function(modelValue, viewValue) {
47+
return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
4848
};
4949
}
5050
};

0 commit comments

Comments
 (0)