【发布时间】:2014-11-20 15:44:43
【问题描述】:
我有一个使用把手作为视图模板引擎的快速应用程序。
我有一个页面被编写为车把模板。问题是该页面的一部分必须由服务器渲染,而其他部分必须在客户端渲染。
<body>
<div>my page with handlebars {{me}}</div>
<script id="each-template" type="text/x-handlebars-template" src="/partials/model1.js">
sample template {{friend}}
</script>
</body>
问题是页面完全呈现给客户端(包括 中的模板)。
<body>
<div>my page with handlebars Patricio</div>
<script id="each-template" type="text/x-handlebars-template" src="/partials/model1.js">
sample template
</script>
</body>
但应该是:
<body>
<div>my page with handlebars Patricio</div>
<script id="each-template" type="text/x-handlebars-template" src="/partials/model1.js">
sample template {{friend}}
</script>
如何得到这个结果?
【问题讨论】:
标签: node.js express handlebars.js