mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Add example to docs for nested template delimiters. [closes #628] [ci skip]
This commit is contained in:
committed by
John-David Dalton
parent
b56d7ab9c3
commit
b3a4b8085c
@@ -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 } });
|
||||
|
||||
Reference in New Issue
Block a user