I am attempting to add Font Awesome Icons via cellRenderer in ag-grid.
How can I properly render <fa-icon>
tags within a cell render?
Here is what I attempted:
{
width: 150,
headerName: 'Events',
// tslint:disable-next-line: object-literal-shorthand
cellRenderer: (params: any) => {
const PHD: boolean = params.data.PHD;
const DG: boolean = params.data.DG;
const HOT: boolean = params.data.HOT;
let result = '';
if (PHD) {
result = result + '<fa-icon [icon]="faCoffee"></fa-icon>';
}
if (DG) {
result = result + '';
}
if (HOT) {
result = result + '';
}
return result;
},
resizable: true,
filter: false,
},
Here is how it renders from cellRenderer:
Placing the tag within the component HTML works and renders to the page like this: