angular - 当我将属性传递给带有管道的组件时,如何将一个日期与字符串连接起来?
问题描述
我正在使用 kendoUi 的一个组件,我需要传递属性 [title] 我的变量local.localNome
(string)
和 local.LocalDataCadastro(Date with a pipe)
我尝试类似:
<kendo-panelbar-item *ngFor="let local of locaisList" [title]="local.LocalCadastroData | date + local.LocalNome">
但这样我收到:
[local.LocalCadastroData | 中第 32 列的意外标记“+” 日期 + local.LocalNome]
我如何在[title]
属性中使用我的两个变量和pipe
日期?
解决方案
尝试将 date 和 local.LocalNome 放在括号中,以便它作为 JS 执行。
<kendo-panelbar-item *ngFor="let local of locaisList" [title]="local.LocalCadastroData | {{date + local.LocalNome}}">
推荐阅读
- java - 如何以编程方式从android应用程序的文件和文件夹中删除世界读/写权限?
- ios - iOS Firestore 可以将 `FieldValue.increment` 用于 Map 值吗?
- javascript - Google Places API 上的 CORS 错误,但 Reddit 上没有
- python - Pyperclip 模块在 Android 上失败
- java - 如何知道背包问题(DP实现)中选择了哪个项目?
- vue.js - Parcel vue 调试:如何将 parcel serve 的输出映射到我的源代码?
- java - Spring Batch:如何配置 FlatItemFileReader 来读取压缩的 ND-JSON 文件?
- visual-studio - 在 Visual Studio 2013 中找不到这些选项
- python - 如何通过根据值字典的长度对嵌套字典进行排序来创建排序字典?
- java - 传递给新活动的数据为空