Angular 2+: Get child element of @ViewChild()

前端 未结 4 1165
[愿得一人]
[愿得一人] 2021-01-17 19:04

How can I access the child elements (here: ) of @ViewChild() in Angular 2+ without explicit declaration?

In template.htm

4条回答
  •  难免孤独
    2021-01-17 19:44

    In your case, when you need only one and first child.

    this.parent.nativeElement.firstChild

提交回复
热议问题