【问题标题】:how to properly call google closure strContains如何正确调用谷歌关闭 strContains
【发布时间】:2013-07-25 04:34:10
【问题描述】:

当我尝试编译包含此闭包代码的大豆模板时

 {if  strContains($field, "date") }

这是错误

com.google.template.soy.base.SoySyntaxException: 并非所有代码都采用 Soy V2 语法(发现标签 {if strContains($field, "date")} 不在 Soy V2 语法中)。

我在这里遗漏了什么吗? 我使用这个命令编译了大豆模板

java -jar SoyToJsSrcCompiler.jar --outputPathFormat templates.js templates.soy

请帮忙!提前致谢。

【问题讨论】:

  • {if strContains($field, 'date') } 单引号。

标签: closures google-closure google-closure-library google-closure-templates


【解决方案1】:

大豆模板使用单引号字符串。所以将“日期”替换为“日期”。

【讨论】:

    猜你喜欢
    • 2014-05-23
    • 1970-01-01
    • 1970-01-01
    • 2022-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-01
    • 1970-01-01
    相关资源
    最近更新 更多