Add example to docs for nested template delimiters. [closes #628] [ci skip]

This commit is contained in:
jrajav
2014-07-15 10:41:42 -05:00
committed by John-David Dalton
parent b56d7ab9c3
commit b3a4b8085c

View File

@@ -8125,6 +8125,11 @@
* compiled({ 'name': 'mustache' });
* // => 'hello mustache!'
*
* // delimiters cannot be nested, even in strings
* var compiled = _.template('<%- "<%- value %>" %>');
* compiled({});
* // => throws error
*
* // using the `imports` option to import `jQuery` as `jq`
* var text = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });