0
我正在使用胡子,并且我有一个由不同HTML文件使用的模板。如何在单独的文件中分离模板?
<script id="template" type="text/template">
{{#repo}}
<b>{{name}}</b>
{{/repo}}
</script>
我想这个模板在一个单独的文件隔离,如:
<script id="template" type="text/template" src="./js/template-must"></script>
但是,这是行不通的。有任何想法吗?
如果你使用的是RequireJS,你可以试试[text插件](https://github.com/requirejs/text) – explunit 2013-03-14 19:58:50