Nesting Handlebars helpers into templates.
If you are building a lot of html templates using Handlebars then here is a walk through of slimming them down using Require.js, require handlebars plugin and Handlebars helper system.
A really good use case for this is building forms. Say you wanted to keep a common className and structure across all your app. You might start with a simple form like this one:
|
|
The first thing we could do would be to create reusable helpers which will build the label and input elements.
Dave Taylor - Software Engineer