Hide Angular 2 material tooltip like ngIf
If I understand your request correctly you want to show tooltip only when a certain condition is met, try this:
<div [matTooltip]="isWide ? 'Visible' : null"></div>
You can do it like this:
<button
mat-raised-button
color="primary"
[matTooltip]="test ? 'You must complete all the required fields.' : null"
matTooltipPosition="above"
>
Primary
</button>
If you want to show the tooltip when it's false, just replace null
with your text.