mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs(forms): clarify disabled FormArray value behavior
Document that FormArray.value includes only enabled child controls when the array is enabled, but includes all child values when the FormArray itself is disabled. Fixes #67759
This commit is contained in:
parent
24c5400185
commit
789c2cd9fb
2 changed files with 4 additions and 2 deletions
|
|
@ -554,7 +554,8 @@ export abstract class AbstractControl<
|
|||
* with a key-value pair for each member of the group.
|
||||
* * For a disabled `FormGroup`, the values of all controls as an object
|
||||
* with a key-value pair for each member of the group.
|
||||
* * For a `FormArray`, the values of enabled controls as an array.
|
||||
* * For an enabled `FormArray`, the values of enabled controls as an array.
|
||||
* * For a disabled `FormArray`, the values of all controls as an array.
|
||||
*
|
||||
*/
|
||||
public readonly value!: TValue;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ export type ɵFormArrayRawValue<T extends AbstractControl<any>> = ɵTypedOrUntyp
|
|||
*
|
||||
* A `FormArray` aggregates the values of each child `FormControl` into an array.
|
||||
* It calculates its status by reducing the status values of its children. For example, if one of
|
||||
* the controls in a `FormArray` is invalid, the entire array becomes invalid.
|
||||
* the controls in a `FormArray` is invalid, the entire array becomes invalid. Similarly, if all
|
||||
* controls in a `FormArray` are disabled, the entire array becomes disabled.
|
||||
*
|
||||
* `FormArray` accepts one generic argument, which is the type of the controls inside.
|
||||
* If you need a heterogenous array, use {@link UntypedFormArray}.
|
||||
|
|
|
|||
Loading…
Reference in a new issue