【发布时间】:2015-04-16 00:56:14
【问题描述】:
我有这个模板:
<template name="index">
{{#if currentUser}
{{userid}}
{{/if}}
</template>
有什么区别
Template.index.helpers({
userid: function() {
return Meteor.user()._id;
}
});
与
Template.index.helpers({
userid: Meteor.user()._id
});
最后一个给出了这个错误: 未捕获的类型错误:无法读取未定义的属性“_id”
【问题讨论】:
标签: javascript meteor