我尝试在主干中制作一个简单的视图,按下按钮(使用.buy-products类)它必须触发'buyProducts'方法,但它没有,请帮助
var CurrProducts = Backbone.View.extend({
events: {
"click .buy-products": 'buyProducts'
},
buyProducts: function() {
console.log("working1");
},
render: function() {
return this;
}
});
var test = new CurrProducts();
test.render()