鉴于这些模板:
<script id="template1" type="layout">
Template 1 contents
</script>
<script id="template2 type="layout">
Template 2 contents
<section class="subview"></section>
</script>
这个视图设置:
var View1 = Backbone.LayoutView.extend({
template: "#template1"
});
var View2 = Backbone.LayoutView.extend({
template: "#template2",
views: {
".subview": new View1();
}
});
我得到这个输出:
Template 2 contents
<section class="subview"><div>Template 1 contents</div></section>
我怎样才能得到这个输出?
Template 2 contents
<section class="subview">Template 1 contents</section>