underscore666
underscore666

Reputation: 1739

model.bind and model.on: Are these methods equivalent? Which one should I prefer?

I did try the following in my initialise function in Backbone.View

this.model.bind('change', this.render, this);
this.model.on('change', this.render, this);

Apparently they work the same way.

Are this method equivalent.
Which one should I prefer?

Upvotes: 3

Views: 858

Answers (1)

thedersen
thedersen

Reputation: 243

Yes, they are equivalent. However, bind (and unbind) are only kept for backwards compability. You should use on.

Hope this helps!

Upvotes: 6

Related Questions