Given these templates:
<script id="template1" type="layout">
Template 1 contents
</script>
<script id="template2 type="layout">
Template 2 contents
<section class="subview"></section>
</script>
And this view setup:
var View1 = Backbone.LayoutView.extend({
template: "#template1"
});
var View2 = Backbone.LayoutView.extend({
template: "#template2",
views: {
".subview": new View1();
}
});
I get this output:
Template 2 contents
<section class="subview"><div>Template 1 contents</div></section>
How can I instead get this output?
Template 2 contents
<section class="subview">Template 1 contents</section>
I would use the following in your template keeping template 1's template the same:
Then in your view
This would give you the following
I have found no other way of removing the 'div' unless by specifying a tagName attribute.