Using JQuery templates, what is the best way to output literal ${}
and {{ }}
strings?
I need this because I would like to write templates that themselves generate other templates.
litteral ${} and {{ }} in jquery templates
584 Views Asked by Darren Willis At
2
There are 2 best solutions below
1

I don't think you want to write ${} and {{}} as literals. I think you want to use nested templates: http://api.jquery.com/template-tag-tmpl/
I am not sure of your exact needs, but if you are, for whatever reason, not able to use nested templates, then how about as a workaround either something like:
or
with writeVariable (and other helpers or a more generic/advanced version of this one) defined elsewhere:
I did see reference in another post to a {#literal} tag, but I don't see that available anywhere in recent jquery.tmpl.js code.