我想提取一個靜態HTML文件,我將在前端JavaScript中用作Underscore模板。我已經嘗試過以下運氣:在Grails中導入一個HTML模板
<link rel="import" href="${resource(plugin: 'my-app-name', dir: 'tpl', file: 'foo.html')}"/>
<g:external dir="tpl" file="foo.html" type="html" />
該文件位於web-app/tpl/foo.html。
最終目標是使用新的HTML導入語法通過JavaScript訪問文件的內容。
你好格蘭特,謝謝你的回答。我沒有使用GSP,因爲它是用於Backbone(JavaScript)的Underscore模板。 –