angular 父组件调用子组件方法
父组件TS代码:
<app-son #datepicker></app-son>
@ViewChild('datepicker') datepicker: childComponent;
refreshClick() {
this.datepicker.clearTime();
}
子组件TS代码:
clearTime() {
this.times = null;
}
angular 父组件调用子组件方法
父组件TS代码:
<app-son #datepicker></app-son>
@ViewChild('datepicker') datepicker: childComponent;
refreshClick() {
this.datepicker.clearTime();
}
子组件TS代码:
clearTime() {
this.times = null;
}