我有一个模板文件,只生成一些html(所以没有App.ListView)。例如,假设我有一个“列表”定义如下:
<script type="text/x-handlebars" data-template-name="list">
<div class="list">
</div>
</script>
现在的问题是如何在其他模板中定位此模板
{{view "list" contextBinding="this"}}
这是jsfiddle
有什么建议吗?
干杯
答案 0 :(得分:1)
您可以使用{{template}}
。
<script type="text/x-handlebars" data-template-name="application">
{{template list}}
</script>
请参阅相关答案,了解各种帮助者的细分:Different rendering techniques in emberjs handlebars template