1
传达我有一个看起来像这样path: '/speakers/singleDetails/:_id'
像这样路线:_id与模式_id场流星
speakerId: {
type: String,
autoValue: function(){
return this.params._id;
}
}
与现场架构的路径我想要的speakerId
领域的autoValue
返回/:_id
那追加到path
,但我正在逐渐Uncaught TypeError: Cannot read property '_id' of undefined
UPDATE
我现在设置我idPath
在我的路由器和get
它在采集模式
onBeforeAction: function(){
console.log(this.params._id);
Session.set('idPath', this.params._id);
this.next();
}
speakerId: {
type: String,
autoValue: function(){
return Session.get('idPath');
}
}
但现在我得到这个错误:Exception in delivering result of invoking '/singleDetails/insert': Error: Internal server error [500]
你能看看我更新的帖子吗? – redress 2015-02-05 18:14:19
'错误:内部服务器错误[500]'我可以在控制台上看到日志吗?服务器控制台 – Ethaan 2015-02-05 18:20:06
检查答案更新,我们在'speakerId'字段中加入'if(this.isInsert)' – Ethaan 2015-02-05 18:24:14