Skip to content
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
diegomrsantos opened this issue Feb 28, 2017 · 2 comments

Comments

@diegomrsantos
Copy link
Contributor

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

@Narretz
Copy link
Contributor

Narretz commented Feb 28, 2017

Would you like to add this change to the migration guide?

@Narretz Narretz added this to the Backlog milestone Feb 28, 2017
@diegomrsantos
Copy link
Contributor Author

sure, I'll do that

diegomrsantos added a commit to diegomrsantos/angular.js that referenced this issue Feb 28, 2017
…ern and pattern breaking change

Introduced in commit 0e00108

Closes angular#15758
Narretz pushed a commit that referenced this issue Mar 7, 2017
Breaking change was introduced in commit 0e00108.
This content being included in the migration guide is taken from the commit message of commit 0e00108.

Closes #15758
Closes #15765
Narretz pushed a commit that referenced this issue Mar 7, 2017
Breaking change was introduced in commit 0e00108.
This content being included in the migration guide is taken from the commit message of commit 0e00108.

Closes #15758
Closes #15765
ellimist pushed a commit to ellimist/angular.js that referenced this issue Mar 15, 2017
Breaking change was introduced in commit 0e00108.
This content being included in the migration guide is taken from the commit message of commit 0e00108.

Closes angular#15758
Closes angular#15765
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants