Guys, I'm new to backboneJs, and I tried to write a basic program to return the value in events.on, as shown below, but this does not work.
$(function(){ // object.on(event, callback, [context])Alias: bind var object = {}; _.extend(object, Backbone.Events); object.on('add',function(a,b){ return a + b; }); var sum = object.trigger('add',1,3); // not as I expected. alert(sum); });
I hope someone will give me some ideals, thanks a lot.
source share