【发布时间】:2019-04-29 23:59:49
【问题描述】:
这是我的代码:
{template .someTemplate}
{@param? icon : string} /** CSS class that loads and styles the icon */
{@param? headlineHtml : any} /** Headline text with optional html for styling */
{@param? textHtml : any} /** Subtext with optional html for styling */
{@param? buttonText : string} /** The call to action text for the button */
{@param? rejectButtonText : string} /** The text for choosing to reject the call to action */
....
当我尝试编译时,我收到一条错误消息:
Exception in thread "main" com.google.template.soy.base.SoySyntaxException: In file ./myfile.soy:7, template com.namespace.someTemplate: Not all code is in Soy V2 syntax (found tag {@param? icon : string} not in Soy V2 syntax).`
我在网上找到的唯一信息似乎表明这是正确的语法(根据Google's site here,根据我发现的this cheat sheet),但谷歌搜索“soy v2”并没有给我任何解释什么的结果是正确的 Soy V2 语法。
定义这些参数的正确方法是什么?
【问题讨论】:
标签: google-closure-templates soy-templates