【发布时间】:2012-09-13 12:29:26
【问题描述】:
我正在关注 Rails 的 Ryan Bates 主干.js 教程。他使用 jst.eco 模板。但是,我使用的是 jst.ejs 文件。
他的视图创建了一些他想插入到模板中的内容,即“Entries go here”
$(this.el).html(this.template(entries: "Entries go here"));
return this;
它会被插入到模板中的<%= @entries %>
<h1>App Name</h1>
<%= @entries %>
我正在使用 index.jst.ejs 文件执行此操作,但它不起作用。
首先。有谁知道我应该在模板中使用哪些标签来呈现动态内容?
其次,在template()括号内做entries: "Entries go here"是否仍然正确,如
$(this.el).html(this.template({entries: "Entries go here"}));
注意,我没有使用咖啡脚本
【问题讨论】:
标签: backbone.js ejs