angular AG Grid ICellRendererAngularComp not found

846 Views Asked by At

Ive just started using AG Grid and Im having a problem with the demos

** see link below

the example references ICellRendererAngularComp which it says is located in

ag-grid-community/angular

but I cant find it. Heres the typescript code, can anyone shed any light on this ? Ive got the grid installed correctly on my system (Angular 11) but I cant figure out where this comp is

import { ICellRendererAngularComp } from '@ag-grid-community/angular';
import { ICellRendererParams } from '@ag-grid-community/core';
import { Component } from '@angular/core';

@Component({
  selector: 'medal-component',
  template: `<span>{{ this.displayValue }}</span>`,
})
export class MedalCellRenderer implements ICellRendererAngularComp {
  public displayValue!: string;

  agInit(params: ICellRendererParams<IOlympicData, number>): void {
    this.displayValue = new Array(params.value).fill('#').join('');
  }

  refresh(params: ICellRendererParams) {
    return false;
  }
}

I get an error 'Module ag-grid-community has no exported member ICellRendererAngularComp' and @ag-grid-community/angular doesnt exist only @ag-grid-community exists

looks like the plunket link doesnt work, Ive accessed the samples from this url

AG Grid samples

1

There are 1 best solutions below

0
misuk On

Ok, managed to solve this myself. Im using the legacy version of ag-grid, so the import should be this

import { ICellRendererAngularComp } from 'ag-grid-angular-legacy';

im using angular 11 so I have to use the legacy version, angular 12 and up uses the standard angular grid