I saw the post access function in one view from another in backbone.js. If i want to pass parameter to loadTaskPopup(param) how can i do that ?
Backbone.View.prototype.event_aggregator = _.extend({}, Backbone.Events);
window.PopupView = Backbone.View.extend({
initialize: function() {
_.bindAll(this, "loadTaskPopup");
this.model = new PopupModel();
this.event_aggregator.bind("tasks_popup:show", this.loadTaskPopup);
},
loadTaskPopup: function(param) {
//do something with the parameter
}
});
window.TaskbarView = Backbone.View.extend({
loadTaskbarPopup: function() {
this.event_aggregator.trigger("tasks_popup:show") //How to pass parameter ?
}
});