Relative Content

Tag Archive for angulartypescripttypescript-generics

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.