I have the following line in the template of an angular component
<tr dt-row-placeholder [contents]="dtElements" [context]="datum" *ngFor="let datum of model.Collection"></tr>
however, i get the following error on build
Error: src/sp-data-table/data-table-body/data-table-body.component.html:27:55 - error TS2322: Type 'any' is not assignable to type 'never'. 27 <tr dt-row-placeholder [contents]="dtElements" [context]="datum" *ngFor="let datum of model.Collection"></tr>
I’m wondering if there is anything I can do to resolve this while leaving fullTemplateTypeCheck enabled. Setting fullTemplateTypeCheck to false fixes the issue but means I’m losing out on the benefits it provides in other parts of the app.
My hunch is that, although "context" and "datum" appear as type "T" in the hover, typescript has no way of knowing that the T of "DataTableRowPlaceholderComponent" is the same T as "datum" which is an element of a T defined on a property of the containing component. I guess my question is, is there any way for me to tell angular that the two "T"s refer to the same type? It is curious to me that the error seems to indicate that "context" is of type "never" and "datum" is of type "any" when the intellisense hover somehow knows they are not those types.
Source: Angular Questions