gpt4 book ai didi

angular - TemplateRef 需要类型参数

转载 作者:太空狗 更新时间:2023-10-29 17:09:31 27 4
gpt4 key购买 nike

组件 HTML:

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

组件 TS:

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

Visual Studio 消息:

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

我应该只做它吗 TemplateRef<any> ?代码示例似乎从未指定泛型。这是新的吗?

最佳答案

他们在 Angular Material 2 中使用

TemplateRef<any>

无处不在 https://github.com/angular/material2/search?utf8=%E2%9C%93&q=templateref&type=

我还没有看到任何与此类型参数相关的内容。

关于angular - TemplateRef 需要类型参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45976862/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com