Re:Rethinking Backbone.js View Rendering
by bjhoops1 on Friday March 08, 2013 @12:14PM
(#5344502)
Yes, Handlebars is explicitly designed for logicless templating. If you need real logic in your View (which I might add is often a good time to step back and possibly refactor your solution), you can always fall back on Underscore's templating.
I frequently do this in my apps - I use Handlebars by default, but fall back on _.template() any time my view's absolutely have to have logic in them.
Since Backbone already depends on Underscore, it's harmless in terms of introduced dependencies.
I frequently do this in my apps - I use Handlebars by default, but fall back on _.template() any time my view's absolutely have to have logic in them.
Since Backbone already depends on Underscore, it's harmless in terms of introduced dependencies.