628b0c1154
This commit relaxes the type of the `formControlName` input to accept both a `string` and a `number`. Currently, when using a `FormArray`, most templates look like: ``` <div formArrayName="tags"> <div *ngFor="let tag of tagsArray.controls; index as i"> <input [formControlName]="i"> </div> </div> ``` Here `formControlName` receives a number whereas its input type is a string. This is fine for VE and `fullTemplateTypeCheck`, but not for Ivy which does a more thorough type checking on inputs with `fullTemplateTypeCheck` enabled and throws `Type 'number' is not assignable to type 'string'`. It is fixable by using `formControlName="{{i}}"` but you have to know the difference between `a="{{b}}"` and `[a]="b"` and change it all over the application codebase. This commit allows the existing code to still type-check. PR Close #30606 |
||
---|---|---|
.. | ||
directives | ||
directives.ts | ||
form_builder.ts | ||
form_providers.ts | ||
forms.ts | ||
model.ts | ||
validators.ts | ||
version.ts |