字体真棒+角度:不允许使用空表达式

问题描述

我正在这样的组件中导入很棒的字体(分别尝试了两者):

import * as faInfoCircle from '@fortawesome/pro-solid-svg-icons/faInfoCircle';

import * as faInfoCircle from '@fortawesome/pro-regular-svg-icons/faInfoCircle';

在课程中定义为:

faInfoCircle = faInfoCircle;

在模板中使用:

<mh1-icon-button [icon]="faInfoCircle"
[iconClasses]="['btn']"
(click)=""
[tooltip]="'this is a tooltip'"> test
</mh1-icon-button> 

我收到此错误:

    Uncaught Error: Uncaught (in promise): Error: Template parse errors:
    Empty expressions are not allowed ("n-button [icon]="faInfoCircle"
                      [iconClasses]="['btn']"
                      (click)="[ERROR ->]"
                      [tooltip]="'this is a tooltip'"> test
                      </mh1-icon-button>
    "): ng:///PressureModule/PressureDetailsComponent.html@250:27

寻找解释/了解为什么会发生此错误

解决方法

删除(单击)处理程序。如错误所述,它不能为空。此错误与FontAwesome无关。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...