首页 > 解决方案 > 如果按钮在角度中被禁用,则禁用工具提示文本

问题描述

我是 UI 新手,我对我的 Angular 应用程序有要求,我的按钮将在某些条件下启用和禁用。我想仅在启用按钮时显示工具提示,我可以更改启用/禁用按钮上的光标类型,但想知道如何仅在启用按钮时启用工具提示文本,下面是我的代码。

<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;
}

我做错了什么吗?我怎样才能做到这一点。

标签: javascripthtmlcssangularsyncfusion

解决方案


您可以有条件地添加标题

<button ejs-button type="button" title="{{ data.disable? '' : 'Formula Builder'}}">

推荐阅读