-
Notifications
You must be signed in to change notification settings - Fork 26.2k
feat(forms): multiple validators for array method #20766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e347da6
to
10a9f45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but needs a few tests. Can you add a test that passing multiple validators to FormBuilder works as expected?
@kara I wanted to add test at the beginning but I wasn't sure how to assert since multiple validators are composed into a single function eventually. I pushed a test now which is not working, maybe you know how to do assertion here. |
@harunurhan Rather than checking function identity, try checking whether both async validators have been called as expected. You can use https://github.com/angular/angular/blob/master/packages/forms/test/form_array_spec.ts#L810 as a model. |
1f96304
to
6c2ba5a
Compare
Change array method signature so that array of validator and/or async validatior functions can be passed. Fixes angular#20665
@kara thanks for the tip, pushed new tests. you can have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@IgorMinar Can you take a look for public-api changes? |
Change array method signature so that array of validator and/or async validatior functions can be passed. Fixes angular#20665 PR Close angular#20766
Change array method signature so that array of validator and/or async validatior functions can be passed. Fixes angular#20665 PR Close angular#20766
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Change array method signature so that array of validator and/or async
validatior functions can be passed.
Fixes #20665
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #20665
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Can remove the test if requested, it doesn't seem to be really useful.