0
铁路由器路径控制器我试图加载依赖于用户登录状态像这样不同的模板:铁路由器:路由器控制器来电Meteor.user()返回错误
Router.map(function() {
this.route('start', {
path: '/',
controller: StartController
});
})
StartController = RouteController.extend({
template: Meteor.user() ? 'home' : 'landing',
waitOn: function() {
return [Meteor.subscribe('something')]
}
});
但是我得到异常在控制台中: “...错误:只能在方法调用中调用Meteor.userId。在发布函数中使用this.userId ...”
我真的不明白那个错误意味着什么,我在这里做错了。