Im trying to render a Handlebars template using NodeJS and Backbone.
So far, what i have done works perfectly when inside an HTML file:
app.MyView = Backbone.View.extend({
...
render: function() {
var template = Handlebars.compile( $("#my-template").html());
this.$el.html( template(this.model.toJSON()) );
return this;
}
...
});
View inside HTML:
<script type="text/x-handlebars-template" id="my-template">
{{text}}
</script>
However, if I place this view inside a Handlebars template, it does not work because {{text}} is being interpreted by NodeJS Handlebars compiler.