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 ...」
我真的不明白那個錯誤意味着什麼,我在這裏做錯了。