<i [pTooltip]="picture" tooltipPosition="bottom" class="pi pi-images"></i> <ng-template #picture> <img src="" alt="here img"> </ng-template>
Error Type 'TemplateRef' is not assignable to type 'string'
Is there a way to add a picture
Seems this is a discussed topic on GitHub. So at least currently template is not supported for tooltip. But I found this comment: which says:
Set escape to
false
, and it will render html:
<div pTooltip="Some text <br> next line" tooltipPosition="top" [escape]="false"></div>
This seems to work fine with this sample I tried:
<p pTooltip="<img src='http://placekitten.com/g/100/200' />" [escape]="false">Hover me!</p>
tooltipStyleClass
where you can define your own styles. Check documentation primefaces.org/primeng/showcase/#/tooltip
::ng-deep .target-class-here {.....styles here....}
If that doesn't work, I would suggest to open a new question for that.
<i
pTooltip="<img class='cell-view-file__tooltip' src='{{cell.value}}' alt='{{fileName}}'/>"
[escape]="false"
appendTo="body"
class="pi pi-images"
tooltipPosition="bottom"
tooltipStyleClass="tooltip"