2017-08-31 225 views
2

組件的HTML:TemplateRef需要類型參數

<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>? 雖然代碼示例似乎從未指定泛型。 這是新的嗎?

回答

相關問題