When attempting to display a link on a basic HTML page, the code looks like this:
<a [routerLink]="['/leverance/detail', 13]">A new link</a>
However, when trying to render it within an ag-Grid, the approach is as follows:
src\app\leverancer\leverancer.component.ts
ngOnInit() {
this.dataGridColumnDefs = [
{
headerName: 'Type',
field: 'leveranceType.name',
width: 150,
cellRenderer: this.customCellRendererFunc
}
];
}
customCellRendererFunc(params): string {
const cellContent `<a [routerLink]="['/leverance/detail', 13]">A new link</a>`;
return cellContent;
}
Despite the implementation, the routerLink does not work within my ag-Grid. Could you offer guidance on how to properly render a working routerLink in my ag-Grid?