Skip to content

Commit

Permalink
Merge pull request jashkenas#2716 from braddunbar/template-docs
Browse files Browse the repository at this point in the history
Add docs for the View#template convention.
  • Loading branch information
jashkenas committed Sep 11, 2013
2 parents 42370dd + ace363c commit 476e764
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@
<li><a href="#View-setElement">setElement</a></li>
<li><a href="#View-attributes">attributes</a></li>
<li><a href="#View-dollar">$ (jQuery)</a></li>
<li><a href="#View-template">template</a></li>
<li><a href="#View-render">render</a></li>
<li><a href="#View-remove">remove</a></li>
<li><a href="#View-delegateEvents">delegateEvents</a></li>
Expand Down Expand Up @@ -2616,6 +2617,21 @@ <h2 id="View">Backbone.View</h2>
};
}
});
</pre>

<p id="View-template">
<b class="header">template</b><code>view.template([data])</code>
<br />
Conforms loosely to the result of Underscore's
<a href="http://underscorejs.org/#template"><b>template</b></a>
function, returning an HTML representation of the view. While not
provided by the library, <b>template</b> is an oft-used convention.
</p>

<pre>
var View = Backbone.View.extend({
template: _.template(…)
});
</pre>

<p id="View-render">
Expand Down

0 comments on commit 476e764

Please sign in to comment.