I have "name" variable in the view and I want to display something like this in the rendered HTML:
${Jon}
Right now, my code is like this:
<li>
{{name}}
</li>
I am storing name
in the view directly as "${" + model.name + "}"
. But I dont want to store names this way, I want to display the characters $
, {
and }
in the handlebars template.
How to you escape { and } in the handlebars to be normal strings?
I have "name" variable in the view and I want to display something like this in the rendered HTML:
${Jon}
Right now, my code is like this:
<li>
{{name}}
</li>
I am storing name
in the view directly as "${" + model.name + "}"
. But I dont want to store names this way, I want to display the characters $
, {
and }
in the handlebars template.
How to you escape { and } in the handlebars to be normal strings?
Share Improve this question asked Apr 29, 2013 at 5:34 Dhwaneet BhattDhwaneet Bhatt 5861 gold badge8 silver badges19 bronze badges1 Answer
Reset to default 4You can use the HTML ASCII code:
{ = '{'
} = '}'
example:
<li>{{{item}}}</li>
if item = 'apple'
, then this bees:
{apple}
JSBin example