【发布时间】:2014-01-11 20:00:31
【问题描述】:
为什么顶层对象数据在handblebars 的#each 中消失了?例如,
jquery + 车把,
$(this).html(Handlebars.getTemplate('summary')({
base_url: "http://www.mywebsite.com/", // what I mean by the top level data
types: {
page: {...},
post: {...}
}
}));
把手模板,
{{ base_url }} // I get http://www.mywebsite.com/
{{#each types}}
{{ base_url }} // I get nothing
{{/each}}
那么我怎样才能保留顶级数据呢?
【问题讨论】:
标签: jquery foreach iteration handlebars.js