I need assistance displaying data in a tooltip in JSON format similar to the image provided.
Although I can load the data in the tooltip, it does not appear formatted like the attached picture.
<ng-container matColumnDef="Alert">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alert </th>
<td mat-cell *matCellDef="let row">
<span matTooltip="{{(row?.conditionals)?(row.conditionals | json):''}}">{{row.Alert}}</span>
</td>
</ng-container>
You can find the Stackblitz link with the HTML and TypeScript code here.
https://stackblitz.com/edit/angular-mat-tooltip-xngsaq?file=app%2Ftooltip-overview-example.ts
When hovering over the first column, I would like the tooltip to display Conditionals, Offset, and Alert as shown in the attachment.
#EDIT1 I have also attempted using basic HTML tooltips. If anyone has suggestions on how to format the data for this purpose, that would be greatly appreciated.
https://stackblitz.com/edit/angular-mat-tooltip-ik3f8e?file=app%2Ftooltip-overview-example.css
For further information, you can refer to one of these sources: Pretty-print JSON using JavaScript