我正在声明这样的视图:
var VirtualFileSelectorView = Backbone.View.extend({
selected: function() {
console.log("selected function");
},
initialize: function() {
// Shorthand for the application namespace
var app = brickpile.app;
// bind to the selected event
app.bind('selected', this.selected, this);
}
});
然后我实例化这个视图的两个实例,就像你在这里看到的那样:http: //cl.ly/H5WI
The problem is that when the event selected is fired the function selected is called twice?