diff --git a/index.html b/index.html index 93191fd9..771bc138 100644 --- a/index.html +++ b/index.html @@ -2622,15 +2622,16 @@ ui.Chapter = Backbone.View.extend({
templateview.template([data])
- Conforms loosely to the result of Underscore's
- template
- function, returning an HTML representation of the view. While not
- provided by the library, template is an oft-used convention.
+ While templating for a view isn't a function provided directly by Backbone,
+ it's often a nice convention to define a template function on your
+ views. In this way, when rendering your view, you have convenient access to
+ instance data (this.model, options, and so on).
+ For example, using Underscore templates:
-var View = Backbone.View.extend({
- template: _.template(…)
+var LibraryView = Backbone.View.extend({
+ template: _.template(...)
});
@@ -2646,7 +2647,7 @@ var View = Backbone.View.extend({
var Bookmark = Backbone.View.extend({
- template: _.template(…),
+ template: _.template(...),
render: function() {
this.$el.html(this.template(this.model.attributes));
return this;