2
所以顯示貓鼬的錯誤,我已經在那裏我想用戶如何骨幹意見
this.model.save(user_details, { // this is backbone model
error: function (model, errors) {
},
success: function (model, response) {
}
});
骨幹示範urlRoot點保存到後臺功能,其中
// here user is a Mongoose schema
user.save(function (err) {
if (err) {
res.send(err.errors);
}
});
我一個骨幹視圖我正在Mongoose模式中運行一些驗證。
如果驗證失敗,我如何在主幹視圖上顯示這些「err.errors」。 我可以看到在終端,如果我控制檯登錄錯誤,但不能發送他們回到意見。