我有这个模板脚本
<script id="some-template" type="text/x-handlebars-template">
{{#users}}
{username}
{email}
</script>
Run Code Online (Sandbox Code Playgroud)
我想将它外包给一个名为"user_template.js"的文件,它看起来像这样:
{{#users}}
{username}
{email}
Run Code Online (Sandbox Code Playgroud)
并在主index.html中建立此链接:
<script id="some-template" type="text/x-handlebars-template" src="user_template.js"></script>
Run Code Online (Sandbox Code Playgroud)
问题是 - 它不起作用 - 我该怎么办?