【发布时间】:2018-10-16 17:24:44
【问题描述】:
我的 Ag-grid 列中有一个列,其中我插入了一个组件,该 pusal 调用我的控制器的功能。
我可以毫无问题地访问我的控制器,但是当我尝试调用我的控制器的另一个函数时,我不能,因为当我输入它时,它不是指我的控制器,而是指 ag-grid 组件。
// 组件
this.columnDefs = [{
headerName: '',
width: 50,
cellRendererFramework: ActionCellRendererComponent,
cellRendererParams: {
icon: 'fa-trash',
action: this.downloadAttachmentAction
}
},
downloadAttachmentAction(params: any) {
this.otherFunction() <-- I can not do the functions of my controller. with "this" as it refers to ag-grid
}
otherFunction(){
}
【问题讨论】: