问题
How do you escape curly braces in a Polymer template? I've seen both of these as suggestions but they both throw "Invalid expression syntax" errors.
- {{ '{{' }}var{{ '}}' }}
- {{ '{{var}}' }}
回答1:
How about {{'\{{var}\}'}}? Seems to work.
回答2:
To escape things like {{..asdf..}} or [[..asdf..]] in regular HTML code in the template use ­ in between: {­{..whatever..}­}
来源:https://stackoverflow.com/questions/24966597/how-do-you-escape-braces-var-in-a-polymer-template