Ag-Grid ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'ɵcmp' property

Viewed 1293

Im using angular 11.1.0 with ag-grid 24.0.0

When I try to load a dynamic angular component with the frameworkComponent @Input I get this following error: ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'ɵcmp' property.

This is how I declare it in the HTML:

<ag-grid-angular style="width: 100%; height: 300px;" class="ag-theme-alpine" [frameworkComponents]="frameworkComponents" [rowData]="item.condittions", (gridReady)="onGridReady($event)" [columnDefs]="columnDefs">

And in the component:

frameworkComponents: { audianceCellRenderer: AssetsCellRendererComponent, };

columnDefs = [ {field: 'name'}, {field: 'sendEmail'}, {field: 'audiance', cellRendererFramework: 'audianceCellRenderer'}, {field: 'sop'}, ];

I have tried adding the component to entryComponents, tried adding the component to the withComponnet method of Ag-grid but with no success.

Any help would be appreciated.

1 Answers

For anyone that comes up with this issue, My mistake was this line:

{field: 'audience, cellRendererFramework: 'audianceCellRenderer'},

I accidentally entered the key of the component and not the component itself.

Im sure I'm not going to make this mistake again :)

Related