derickbailey/backbone.marionette — Issue #37: Uncaught TypeError: Object [object Object] has no method 'on'
Author: jessecravens
Created: 2012-02-29 16:39:02+00:00
State: open

After upgrading to from 2.1 to 4.8, to get access to new CompositeView methods, I get the following error:

Uncaught TypeError: Object [object Object] has no method 'on'

I see where the change was made, any ideas on what changes I would need to make in my implementation to resolve this.

bindTo: function (obj, eventName, callback, context) {
context = context || this;
obj.bind(eventName, callback, context);

if (!this.bindings) this.bindings = [];

this.bindings.push({
obj: obj,
eventName: eventName,
callback: callback,
context: context
});
},

bindTo: function (obj, eventName, callback, context) {
context = context || this;
obj.on(eventName, callback, context);

if (!this.bindings) this.bindings = [];

this.bindings.push({
obj: obj,
eventName: eventName,
callback: callback,
context: context
});
},

Any ideas?