I'm building a single page web app when Backbone.js is my MV* framework. It requires Underscore.js so I wan't to use it as my template engine. I set the template result as the view content to display in it's render function:
this.el.append( compiledTemplate );
I wonder about the right way to implement the template code:
- Should it be a JS code that produce an HTML text?
- Should it be an HTML file with a script tag to include the JS code?
- How can I separate the display from the logic?
- How can I write my CSS in a separate file (not in JS file)?