how to properly call google closure strContains

552 Views Asked by At

When I try to compile soy template containing this closure code

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

This is the error

com.google.template.soy.base.SoySyntaxException: Not all code is in Soy V2 syntax (found tag {if strContains($field, "date")} not in Soy V2 syntax).

Am I missing something here? I compiled the the soy template using this command

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

Please help! Thanks in advance.

1

There are 1 best solutions below

0
On

Soy templates use single quoted strings. So replace "date" with 'date'.