
[英]Angular2: How to get a reference to a ViewChild in a child component
[英]How to get reference to an element in html in another component? I guess @ViewChild works in same component
设想:
parent.html 有 child1.html 和 child2.html
child1.html 有一个 div。
child2.ts 想要访问这个 div 并检查它的长度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.