Update doc whitespace and _.template doc example. [ci skip]

This commit is contained in:
John-David Dalton
2013-11-13 00:20:17 -08:00
parent 37ccc80ba4
commit ac5e92c879
5 changed files with 24 additions and 24 deletions

View File

@@ -2254,8 +2254,8 @@ Binds methods of an object to the object itself, overwriting the existing method
#### Example
```js
var view = {
'label': 'docs',
'onClick': function() { console.log('clicked ' + this.label); }
'label': 'docs',
'onClick': function() { console.log('clicked ' + this.label); }
};
_.bindAll(view);
@@ -4237,8 +4237,8 @@ _.template('hello {{ name }}!', { 'name': 'mustache' });
// => 'hello mustache!'
// using the `imports` option to import jQuery
var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
_.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
_.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
// => '<li>fred</li><li>barney</li>'
// using the `sourceURL` option to specify a custom sourceURL for the template