title: Angular2 - Ag Grid - Get Parent Instance in Cell Renderer Component
body: <p>I am using Ag Grid for displaying a list of items in my Project.
  I have implemented Ag Grid with colDef for grid as like below</p>
  
  <p><strong>custom.component.ts</strong></p>
  
  <p><strong>CustomComponent</strong></p>
  
  <p>//colum definition array</p>
  
  <pre><code>[
               {
                  headerName: "Actions", 
                  field: "action", 
                  width: 100,
                  cellRendererFramework: ActionRendererComponent,
              },
  ]
  </code></pre>
  
  <p><strong>ActionRendererComponent</strong></p>
  
  <pre><code>import {Component} from '@angular/core';
  import {AgRendererComponent} from 'ag-grid-ng2/main';
  
  @Component({
      selector: 'action-cell',
      template: `
      &lt;a href="javascript:" *ngIf="showEditLink" (click)="edit()"&gt;&amp;nbsp;&amp;nbsp;Edit&lt;/a&gt;
      &lt;a href="javascript:" *ngIf="showSaveLink" (click)="save()"&gt;&amp;nbsp;&amp;nbsp;Save&lt;/a&gt;
      &lt;a href="javascript:" *ngIf="showCancelLink" (click)="cancel()"&gt;Cancel&lt;/a&gt;
      `
  })
  
  export class ActionRendererComponent implements AgRendererComponent {
   public edit(){
    ..some logic here
   }
   public save(){
    ..some logic here
   }
   public cancel(){
    ..some logic here
   }
  }
  </code></pre>
  
  <p>Now the issue is i cannot get access to parent instance CustomComponent
  in any of the functions in <strong>ActionRenderer</strong> like save(), edit(), cancel().
  How can i pass parent instance into <strong>ActionRenderer</strong> component?</p>