I'm using ag-grid and reacting to some events I want to access to methods defined in the current componnet something like this:
@Component({
selector: 'whatever',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit, OnDestroy{
...
methodToCall(params : any){
return 1;
}
gridOptions = {
onCellValueChanged: function(params : DynamicComponentParams){
*//I want from here to call the method "methodToCall"*
this.methodToCall(null); *//this doesn't work....*
},
.....
};
So from the method: "onCellValueChanged" I need to call the method "methodToCall", using this here is wrong because the scope is different, but then How do I can accomplish that?