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