title: Storing ag-grid rowclicked event data Angular
body: <p>I am trying to store the event data from the <code>onRowClicked</code> event in a Component member. So that when the user hits a button it will be deleted. However when I try accessing it from the delete callback the member variable is undefined.</p>
  
  <pre><code>export class OilTypesComponent implements OnInit {
   ...
   selectedOil : any;
   gridOptions: GridOptions = &lt;GridOptions&gt;{};
  
   ngOnInit() {
   this.gridOptions = {
        ...
        onCellEditingStopped: this.cellEdited,
        onRowClicked: this.rowClicked
      }
   }
  ...
   rowClicked(event){
      this.selectedOil = event.data;
   }
  
  delete(){
      console.log(`Deleting ${this.selectedOil.manufacturer} //this.selectedOil is undefined
    }
  </code></pre>