Handlebars.js and multiple templates
I have a scenario in which I am receiving a json formatted array of objects from the server and I need to load varying handlebars templates based on the content type of the object being passed back. For example, my site is made up of multiple blocks of content and those blocks vary in the way in which they are displayed. So I will have one block that is one width and contains different content than another block which may be a different width and contains an entirely different kind of content that needs to be styled in a different way. I would like to use handlebars so that I am not building out a whole bunch of html with js and then inserting it into the DOM. Any ideas?
How you preload this template mapping and do the rendering depends on what JS libs you are using (if any).
If you provide more details of your templates, the data, and environment some code might be able to be provided.