【发布时间】:2019-04-24 22:17:16
【问题描述】:
我有以下 JSON,
{
"commands": [
{
"command":"begin ${{password}}",
"name":"Initialization",
"description":"Send SMS begin+password"
}
]
}
如何将数据传递给 ${{password}} 以使用传递的值获取填充的字符串?
我尝试使用以下主题中描述的插值函数,但没有任何成功。
Convert a string to a template string
Angular、Ionic 是否为此提供了一些内置函数?
【问题讨论】:
-
这个 JSON 是你编的,还是你从某个地方得到的?
-
我可以编辑 JSON 文件。
-
但是使用单引号的 JSON 不是有效的 JSON。 “命令”:'开始 ${密码}'。我想将变量设置为类范围并将 JSON 值打印到模板。 JSON 中的插值应替换为 Class Scope 中设置的值。
标签: angular ionic-framework ionic4 string-interpolation