Skip to content
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

Validators.minLength(x) doesn't work on FormArray #13089

Closed
SanderHeling opened this issue Nov 25, 2016 · 1 comment · Fixed by #13095
Closed

Validators.minLength(x) doesn't work on FormArray #13089

SanderHeling opened this issue Nov 25, 2016 · 1 comment · Fixed by #13095

Comments

@SanderHeling
Copy link

SanderHeling commented Nov 25, 2016

[x] bug report
[ ] feature request
[ ] support request

Current behavior
When adding Validators.minLength(x) to a FormArray it will not validate. The error also contains actualLength: 0 instead of the actual number of controls in the array.

The validator now only works onFormControl, see PR for the breaking change

Expected behavior
The validator should validate the number of controls in a FormArray. This works in Angular 2.0.2 and lower.

Minimal reproduction of the problem with instructions
http://plnkr.co/edit/bIVqpHvioZkjf9NEC7MB. The initial actualLength is 0 .When you add or remove a FormControl it will not change.

  • Angular version: Angular 2.1.0 and up
  • Browser: All
  • Language: All
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
DzmitryShylovich pushed a commit to DzmitryShylovich/angular that referenced this issue Nov 25, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants