繁体   English   中英

Font Awesome + Angular:不允许使用空表达式

[英]Font Awesome + Angular: Empty Expressions are not allowed

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

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

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

在 class 中定义为:

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 无关。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM