/*the view/template refers to individual items being added to the to do list*/
/*this is the bare minimum code needed*/
/*#item-template: there can only be one*/
<!-- Templates -->
<script type="text/template" id="item-template">
<label><%- title %></label>
</script>
// renders individual todo items list (li)
app.TodoView = Backbone.View.extend({
tagName: 'li',
template: _.template($('#item-template').html()),
render: function(){
this.$el.html(this.template(this.model.toJSON()));
return this; // enable chained calls
}
});