title: In Backbone this.model is undefined, why?
body: <p>I've looked everywhere for an answer but wasn't satisfied with what I've found. </p>
  
  <p>The issue is, I'm doing a tutorial from Addy Osmani to make a 'Todo' app in Backbone, but when I look at the console, I get an error saying that <code>this.model is undefined</code>.</p>
  
  <p>I even tried this SO answer <a href="https://stackoverflow.com/questions/14396586/backbone-model-error-displayed-in-console">Backbone model error displayed in console</a>, but I still get the same error. Please tell me what is wrong.</p>
  
  <p>By the way, what are <code>this.model</code> or <code>this.collection</code>? I've got an idea that they refer to <code>Backbone.Model</code> and <code>Backbone.Collection</code> but how do they work? I'm asking this because in another tutorial <code>this.collection</code> and <code>this.model.models</code> were also undefined, when I've clearly defined the <code>Model</code> and <code>Collection</code>.</p>
  
  <p>Many Thanks</p>
  
  <p>JS:</p>
  
  <pre><code>//Model
  var Todo = Backbone.Model.extend({
  
    defaults: {
      title: 'Enter title here',
      completed: true
    },
  
    validate: function(attrs) {
      if (attrs.title === undefined) {
          return 'Remember to enter a title';
      }
    },
  
    initialize: function() {
      console.log('This model has been initialized');
  
      this.on('change:title', function() {
          console.log('-Title values for this model have changed');
      });
  
      this.on('invalid', function(model, error) {
          console.log(error);
      });
    } 
  });
  
  //View
  var TodoView = Backbone.View.extend({
  
    el: '#todo',
    tagName: 'li',
    template: _.template($('#todoTemplate').html()),
  
    events: {
      'dbclick label': 'edit',
      'click .edit': 'updateOnEnter',
      'blur .edit': 'close'
    },
  
    initialize: function() {
      _.bindAll(this, 'render');
              this.render();
  
    },
  
    render: function() {
      this.$el.html(this.template(this.model.toJSON()));
      this.input = this.$('.edit');
      console.log(this.model.toJSON());
      return this;
    },
  
    edit: function() {
      //do something...
    },
  
    close: function() {
      //do something...
    },
  
    updateOnEnter: function() {
      //do something...
    }
  });
  
  var todoview = new TodoView();
  console.log(todoview.el);
  
  //Collection
  var TodoList = Backbone.Collection.extend({
    model: Todo
  });
  </code></pre>