app.component.html
<h2>
Angular Material - Show & hide Tooltip on button click
</h2>
<div style="padding:25px;
justify-content:space-between; display:flex; width:300px;">
<button mat-flat-button
(click)="tooltip.show()" color="primary">
Show Tooltip
</button>
<button mat-flat-button
(click)="tooltip.hide()" color="warn">
Hide Tooltip
</button>
</div>
<div style="padding:25px;">
<button mat-flat-button
color="secondary"
matTooltipPosition="right"
matTooltip="Sample material tooltip"
#tooltip="matTooltip"
aria-label="Display and hide a material tooltip
on another button click">
Tooltip Button
</button>
</div>
app.module.ts [import]
// for material button
import {MatButtonModule} from '@angular/material/button';
// for material tooltip
import {MatTooltipModule} from '@angular/material/tooltip';
- angular material - Button toggle group appearance
- angular material - How to set Button toggle appearance
- angular material - Button toggle group initially checked items
- angular material - How to show Tooltip
- angular material - How to set Tooltip show hide delay
- angular material - How to enable disable Tooltip
- angular material - Toggle Tooltip visibility on button click
- angular material - How to use Divider
- angular material - Progress bar with percentage
- angular material - How to use indeterminate Progress bar
- angular material - How to use buffer Progress bar
- angular - How to change default font
- angular - How to do a task after a delay
- angular - How to use setInterval()
- angular material - How to use Selection List