TemplateRef requires type argument

Discussão em 'Angular' iniciado por bvdb, Março 17, 2025.

  1. bvdb

    bvdb Guest

    Component HTML:

    <ng-template #content/> </ng-template>


    Component TS:

    @ViewChild('content')
    public content: TemplateRef;


    Visual Studio message:

    [ts] Generic type 'TemplateRef<C>' requires 1 type argument(s)


    Am I supposed to just make it TemplateRef<any> ? Code samples never seem to specify the generics though. Is this new ?

    Continue reading...

Compartilhe esta Página