Although it may seem like a simple question, I'm struggling to find a solution. Here's the issue at hand:
In my Angular Component, there's a function that I need help with.
export class RolesListComponent implements OnInit, OnChanges {
@ViewChild(DxDataGridComponent) dataGrid: DxDataGridComponent;
ngOnChanges(changes: SimpleChanges): void {
this.refresh();
}
refresh(){
this.dataGrid.instance.refresh();
}
}
Unfortunately, calling this.refresh() inside ngOnChanges doesn't work and throws an error stating that refresh is undefined.
Is there a way to either directly execute the code within the function in ngOnChanges, or fix the function itself?