angular cli8父组件调用子组件中的方法

一、首先在父组件中引入ViewChild: import { Component, ViewChild} from '@angular/core'; 二、接着在父组件中引入子组件: import { ChildComponent } from './child/child.component'; 三、在父组件经过@ViewChild关联子组件并调用其方法: // 关联子组件 // 其中{stati
相关文章
相关标签/搜索