我在agGrid中使用Angular。我正在使用agGrid的 onCellValueChanged 属性来注册单元格值的更改。请在这里找到代码:-
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'master-gender',
templateUrl: 'app/PortalPages/MasterPages/GenderMaster/gender.component.html',
})
export class GenderComponent implements OnInit {
private updateDict = new Map();
genderRowData: [];
constructor(private genderService: APICallService) {
}
ngOnInit() {
}
columnDefs = [
{
headerName: 'Gender Name', field: 'Name',
cellEditor: 'agLargeTextCellEditor',
onCellValueChanged: this.genderCellValueChanged.bind(this)
},
]
genderCellValueChanged(event: any) {
//Custom Code for registering event
}
}
是否可以通过任何方式将 genderCellValueChanged 移至其他组件类,即子类并在父子组件之间共享价值?