Triggering Events Across Different Views In Backbone.js
I had an issue recently where I have two separate views, both written using backbone.js, and I needed one view to trigger an event and update another view. I googled around for a while, and found the following two links to be most useful:
http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/
http://stackoverflow.com/questions/9984859/backbone-js-can-one-view-trigger-updates-in-other-views
Get joseph misiti’s stories in your inbox
Join Medium for free to get updates from this writer.
I used the pub-sub solution, and it worked very well:
https://gist.github.com/3146871
Does anyone have a better solution?
Follow me @josephmisiti







