Hacker News new | ask | show | jobs
by ktusznio 4849 days ago
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