-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Validators.minLength(x) doesn't work on FormArray #13089
Copy link
Copy link
Closed
Labels
Description
[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
Reactions are currently unavailable