backbone.js - Object [object Object] has no method 'on' -
I am very new to the spinal cord and I'm studying, to follow her example to create a todo list for. I can not understand why this code does not work:
var Todo = Backbone.Model.extend ({default: {title: "", completed: false}, start: function () {Console.log ("model started"); this.on ("change", function () {console.log ("values for this model have changed.");});}}) ; Var todo1 = new Todo (); The library I have added is jQuery, underscore and backbone. What's wrong with this? Why ".on" is not available? Thanks
on only included in backbone 0.9.0. You need to update it.
Comments
Post a Comment