This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
The ng-pattern validator change from 1.3 to 1.4 is not mentioned in the migration guide #15758
Closed
Description
ng-pattern directive in version 1.3.16 validates modelValue
ctrl.$validators.pattern = function(value) {
return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);
};
ng-pattern directive in version 1.4.14 validates viewValue
ctrl.$validators.pattern = function(modelValue, viewValue) {
// HTML5 pattern constraint validates the input value, so we validate the viewValue
return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
};
it's a breaking change which is not mentioned in the migration guide from 1.3 to 1.4