Angular 中的 dom 操作(ViewChild)以及父子組件中通過 ViewChild 調用子組件的方法

<app-header #header></app-header> <div #myBox> 我是一個dom節點 </div> <button (click)="getChildRun()">獲取子組件的方法</button> /* ViewChild獲取dom節點 1、模板中給dom起一個名字 <div #myBox> 我是一個dom節點
相關文章
相關標籤/搜索