title: ag-grid onGridReady not working
body: <p>I want to load ag-grid inside a button click. I have tried two approaches but none is working</p>
  
  <p>My code : First Method</p>
  
  <pre><code> onBtnClick(){
      this.gridOptions ={
          onGridReady : function(){
              console.log("print");
          }
      }
  }
  </code></pre>
  
  <p>Second method:</p>
  
  <pre><code>onBtnClick(){
      this.onGridReady();
  }
  onGridReady(){
     this.gridApi = params.api;
      console.log("print");
  }
  </code></pre>
  
  <p>First method not working. Second method says api is not defined</p>