我有一篇文章模型,我已經發布並且工作正常。不過,我已經通過simpleSchemas插件添加了以下字段:如何將郵政領域與用戶電子郵件相關聯? [METEOR]
userEmail: {
type: String,
autoValue: function() {
if (this.isInsert) {
return Meteor.user().email;
} else if (this.isUpsert) {
return {$setOnInsert: Meteor.user().email};
} else {
this.unset();
}
}
}
當我有這個啓用後,提交表單不工作,但沒有提出任何錯誤。我可能錯誤地呼籲Meteor.user().email
?如何將userEmail字段與創建該帖子的用戶的電子郵件相關聯?
啊,謝謝你! – zenben1126 2015-04-05 13:13:21