Backbone.listenTo

listenToobject.listenTo(other, event, callback)
Tell an object to listen to a particular event on an other object. The advantage of using this form, instead of other.on(event, callback, object), is that listenTo allows the object to keep track of the events, and they can be removed all at once later on. The callback will always be called with object as context.

view.listenTo(model, 'change', view.render);
doc_Backbone
2016-04-17 12:21:00
Comments
Leave a Comment

Please login to continue.