我正在实现(文档不是很好的)环回方法nestRemoting(),如下所示:
module.exports = function(MyModel) {
MyModel.on('attached', function() {
MyModel.nestRemoting('relationName');
});
}然而,这似乎是非常喜怒无常的。有时候很管用,但大多数时候我会:
Relation `relationName` does not exist for model `MyModel`
at ....stacktrace....
.....有人知道为什么会发生这个错误吗?
发布于 2016-05-18 05:34:08
所以,我找到了解决方案后,只有在发布的瞬间-你只能做nestRemoting后,模型已经是attatched.不是attached。简单的拼写错误可以解决所有的问题。
也许这篇文章将帮助其他试图嵌套端点的人。
https://stackoverflow.com/questions/37290964
复制相似问题