fire an event from one view to another in backbone

Ya, no problem… you’ll want to use the “Event Aggregator” pattern. It’s 1 line of code in Backbone:

var eventAgg = _.extend({}, Backbone.Events);

Now can you trigger / bind to events from this object, everywhere in your app, and have the different parts of your app communicate with each other in a decoupled manner.

I use this a LOT!

I also blogged more about it here: http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/

Leave a Comment