I want to show the data in tooltip in json format as attached in the pic.
I am able to load the data in tooltip(but not the way it is formatted in the picture attached).
<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>
Stackblitz link. The html and ts code is present in stackblitz link.
https://stackblitz.com/edit/angular-mat-tooltip-xngsaq?file=app%2Ftooltip-overview-example.ts
In the tooltip Conditionals, Offset, Alert needs to be shown as in the attached pic, when we hover on first column.
#EDIT1 I also have tried basic html tooltip if anyone can suggest formatting data on this that would also work for me
https://stackblitz.com/edit/angular-mat-tooltip-ik3f8e?file=app%2Ftooltip-overview-example.css
For reference one of the so links pretty-print JSON using JavaScript