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>
Template reference variable should help you to accomplish that:
<span matTooltip="Tooltip!" #tooltip="matTooltip" (click)="tooltip.toggle()">Test</span>
See also
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.