title: referencing 'this' in ag-grid events
body: <p>In ag-grid events, e.g. onRowSelected(), 'this' refers to the grid object. However, I need to reference component variables and don't know how to. What I did was this, but it is a hack:</p>
  
  <pre><code>initializeGridOptions() {
      this.gridOptions = {
        columnDefs: [
          { headerName: "Core #", field: "coreNumber", width: 100, sort: 'asc' },
        onRowSelected: this.onRowSelected,
      }
      this.gridOptions['_this'] = this;  // HACK
    }
  
    onRowSelected(event: any) {
      if (event.node.selected) {
        (this as any)._this.selectedNode = event.node.data;
      }
    }
  </code></pre>
  
  <p>Is there a better way?</p>