Html 引用amp bind宏ID以执行表达式
我试图引用amp bind宏表达式(根据用户输入,我需要使用不同的amp bind表达式) 问题是,当我尝试引用它们时,它不会执行表达式。在控制台中,它显示语法错误。不管我怎么做,我都不能让它工作 下面是我试图实现的代码示例:Html 引用amp bind宏ID以执行表达式,html,expression,amp-bind,Html,Expression,Amp Bind,我试图引用amp bind宏表达式(根据用户输入,我需要使用不同的amp bind表达式) 问题是,当我尝试引用它们时,它不会执行表达式。在控制台中,它显示语法错误。不管我怎么做,我都不能让它工作 下面是我试图实现的代码示例: <amp-bind-macro id="exampleMacro" arguments="input" expression="8*input"></amp-bind-macro> <amp-state id="exampleJson"&g
<amp-bind-macro id="exampleMacro" arguments="input" expression="8*input"></amp-bind-macro>
<amp-state id="exampleJson">
<script type="application/json">
{ "test": "exampleMacro" }
</script>
</amp-state>
<span [text]="[exampleJson.test](input)">0.0</span>
因此,我本以为可以这样做,正如文档链接中的示例所示,amp bind宏
只能由amp bind表达式中的id
引用。例如
0.0
希望有帮助
<span [text]="exampleJson.test(input)">0.0</span>
<span [text]="[exampleJson.test][(input)]">0.0</span>