I want my model to save to the server every time it changes.
I have tried:
initialize: function() {
this.bind('change', this.save());
},
I’m new to Backbone so I’m willing to believe there is a better way to achieve this. Basically I want avoid calling model.save at other points in my code by just automatically saving to the server every time the model changes.
you are calling this.save immediately instead of passing it through as a callback function.remove the parenthesis on
this.save:and your model’s
this.savemethod will be passed in as a function reference, allowing it to be called when the model changes.