私のアプリケーション テンプレートは、index.html ファイル内で宣言されている場合に機能します。しかし、すべてのテンプレートを -AppTmpl.html のように別の html ファイルに保存したい
<!-- SidebarView Template -->
<script id="sideBarTmpl" type="text/template">
<div class="inner_div"><img src="images/com_logo.png"></div>
<div class="inner_div"><img src="images/adv_index.png"></div>
</script>
<!-- HeaderView Template -->
<script id="folderDivTmpl" type="text/template">
<div id="div_<%= menu_sequence %>"></div>
</script>
アンダースコア テンプレートを使用しています。しかし問題は、これらのテンプレートにアンダースコアでアクセスできないことです。のように、this.template = _.template($("#headerTmpl").html(), this.model.toJSON());
したがって、「AppTmpl.html」ファイルをindex.htmlなどに含める必要があります。解決策はありますか?
前もって感謝します !