angular - 使用 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
如何显示序列码?谢谢
解决方案
您需要像[bc-value]="{{PS.SerialId}}"
to一样删除插值[bc-value]="PS.SerialId"
。
这是工作示例: ngx-barcode working example
希望对你有帮助!!!!
推荐阅读
- codenameone - 无法为 IOS 构建:xcode 构建步骤失败
- node.js - Socket.io+Cordova 的客户端是创建无限的连接实例
- magento - Magento 订购电子邮件空白
- jekyll - Jekyll 打印文件内容
- opengl - 从 QImage 创建 QTextureImage
- angular - 页面激活服务后的Angular 5执行功能
- c# - 仅第一项保存在数据库中
- c# - 在 ASP.NET Core Web API 项目中保持控制器温暖
- parallel-processing - 设置计算单元 (CPU) 的数量
- .net - JSON_QUERY(@data, '$') 仅从 JSON 中获取第一个元素