As a beginner in UI development, I have a requirement for my Angular application. I need to enable and disable a button based on certain conditions. The tricky part is that I want to display a tooltip only when the button is enabled. I have managed to change the cursor type depending on the button's status, but I'm struggling with enabling the tooltip text only when the button is active. Below is the relevant code snippet:
<button ejs-button type="button" (click)="formulabuilder(data) [attr.disabled]="data.disable==true?'':null"
title="Formula Builder" class="formula_builder_btn">
<mat-icon role="img" class="mat-icon material-icons mat-icon-no-color"> apps</mat-icon>
</button>
.formula_builder_btn:disabled {
cursor: default;
}
.formula_builder_btn{
cursor: pointer;
}
Am I missing something here? How can I make sure the tooltip is only visible when the button is enabled?