Re:Rethinking Backbone.js View Rendering
by ktusznio on Friday March 08, 2013 @02:53PM
(#5345357)
I've found it useful to abstract away render and work with before/afterRender hooks instead. I still call render which has a base implementation that calls the template, but instead of passing just the model or the model's JSON, I pass a context object that I can build up to suit my needs. This way every template is dealing with the same thing, and the whole mechanism is extensible.
https://gist.github.com/ktusznio/5119318