angular cli8父組件調用子組件中的方法

一、首先在父組件中引入ViewChild: import { Component, ViewChild} from '@angular/core'; 二、接着在父組件中引入子組件: import { ChildComponent } from './child/child.component'; 三、在父組件經過@ViewChild關聯子組件並調用其方法: // 關聯子組件 // 其中{stati
相關文章
相關標籤/搜索