【发布时间】:2016-02-27 08:03:42
【问题描述】:
我正在尝试从流星中的集合中获取信息并使用帮助器将其传递给模板。
这是我在 server.js 上的代码:
Meteor.publish('dataForTableD1', function () {
return Day1.find( { period: 1 } );
});
这是我在 client.js 上的代码:
Template.timetable.helpers({
'day1p1': function() {
Meteor.subscribe('dataForTableD1');
}
});
这是模板代码:
{#with day1p1}}
<td>{{lesson}}</td>
{{/with}}
问题是它不会在呈现的页面中显示任何内容。
我确信这可能是我的错字或类似的东西,因为我对流星很陌生,所以任何帮助都将不胜感激。
【问题讨论】:
标签: javascript html meteor meteor-blaze meteor-helper