美文网首页
angular中@viewChild用法

angular中@viewChild用法

作者: purple1990 | 来源:发表于2019-11-20 17:00 被阅读0次

1.ts文件引入对应组件,写法如下:

@viewChild('CFCL') mktCFCL: DemoCFCLComponent;

2.对应html文件选择器要绑上对应的id,即CFCL,写法如下:

若DemoCFCLComponent组件对应的selector为 k-demoCFCL

<k-demoCFCL #CFCL></k-demoCFCL>

相关文章

网友评论

      本文标题:angular中@viewChild用法

      本文链接:https://www.haomeiwen.com/subject/aquoictx.html