'ElementRef'仅指类型,但在此处用作值

时间:2018-04-25 12:37:26

标签: angular typescript

我试图以这种方式访问​​我的元素:

@ViewChild('addNodeDefinition' , {read: ElementRef}) editNodeModal: ElementRef;

但我收到错误:

  

'ElementRef'仅指类型,但在此处用作值。

我的HTML:

<ng-template #addNodeDefinition></ng-template>

有什么问题?感谢

0 个答案:

没有答案