Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Angular-Material Tooltips toggle method correctly?

I would like to click on the span element once, so that the tooltip appears and then again to hide.

Here is my html. What am I doing wrong?

<span mdTooltip="Tooltip!" (click)="tooltip.toggle()>Test</span>
like image 899
Paul Pinter Avatar asked Jul 27 '26 20:07

Paul Pinter


1 Answers

Template reference variable should help you to accomplish that:

<span matTooltip="Tooltip!" #tooltip="matTooltip" (click)="tooltip.toggle()">Test</span>

See also

  • What is #auto attribute here and why it is required
like image 89
yurzui Avatar answered Jul 29 '26 11:07

yurzui



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!