How to create dynamic type based on other values using typescript?
I have this code in my angular
TypeScript infers wrong type for AbstractControl with generic type
I have an InnerComponent
that takes a FormArray
as input. The component needs access to the type of the controls in the array. Hence I introduce a type parameter ControlValue
and declare that the input must be of the type FormArray<AbstractControl<ControlValue>>
. I’m using the AbstractControl rather than FormControl because it’s fine for the component if the values in the array are structured in any way.