You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface Example {
positions: [number, number][];
}
When I create a FormGroup from the above interface, the type of positions is determined to be FormGroup instead of FormArray. I expect it to be a FormArray because it's an array, not an object.
const group = new FormGroup<ControlsOf>({
positions: new FormArray([
new FormControl(0),
new FormControl(0)
]) // This throws an error because FormArray is not FormGroup.
});
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Type 'FormArray<[number, number], FormArray<number, FormControl<number>>>' is not assignable to type 'FormArray<[number, number], FormGroup<[FormControl<number>, FormControl<number>]>>'.
Type 'FormArray<number, FormControl<number>>' is missing the following properties from type 'FormGroup<[FormControl<number>, FormControl<number>]>': registerControl, addControl, removeControl, contains
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
Yes
The text was updated successfully, but these errors were encountered:
Is this a regression?
No
Description
Version: ^4.1.0
Given the following interface
When I create a FormGroup from the above interface, the type of positions is determined to be FormGroup instead of FormArray. I expect it to be a FormArray because it's an array, not an object.
const group = new FormGroup<ControlsOf>({
positions: new FormArray([
new FormControl(0),
new FormControl(0)
]) // This throws an error because FormArray is not FormGroup.
});
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
Yes
The text was updated successfully, but these errors were encountered: