简单的方法来摆脱大括号?
问题描述:
有没有一种简单的方法可以用Handlebars创建一个字符串{value}?也许类似于:
Is there a simple way to build a string "{value}" with Handlebars? Perhaps something analogous to:
Handlebars.compile("\{{{var}}\}")({var:"value"})
答
Handlebars支持空格〜
字符。以下内容应该适用:
Handlebars support whitespace with the ~
character. The following should work
Handlebars.compile("{ {{~var~}} }")({var:"value"})