首页 > 解决方案 > 使用 ngx-barcode 在运行时生成条形码

问题描述

我想遍历循环并从集合中读取序列,并使用以下代码使用 ngx-barcode 显示它们:

<tbody>
<tr *ngFor="let PS of PrintSerials">
<ngx-barcode [bc-value]="{{ PS.SerialId }}" [bc-display-value]="true"></ngx-barcode>
</tr>
</tbody>

但我收到此错误;

NodeInvocationException:模板解析错误:解析器错误:在 ng:///AppModuleShared/PrintSerialsComponent.html@8:25 ( " ][bc-value]="{{ PS.SerialId }}" [bc-display-value]="true"> "): ng:///AppModuleShared/PrintSerialsComponent.html@8:25

如何显示序列码?谢谢

标签: angularbarcode

解决方案


您需要像[bc-value]="{{PS.SerialId}}"to一样删除插值[bc-value]="PS.SerialId"

这是工作示例: ngx-barcode working example

希望对你有帮助!!!!


推荐阅读