Merge pull request #35 from strongloop/fix/missing-dynamic-converter

Register Models with Dynamic converter
This commit is contained in:
Miroslav Bajtoš 2016-01-26 16:45:33 +01:00
commit 994e3afabc
1 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,11 @@ RemoteConnector.prototype.resolve = function(Model) {
createProxyMethod(Model, remotes, remoteMethod);
}
});
// setup a remoting type converter for this model
remotes.defineType(Model.modelName, function(val) {
return val ? new Model(val) : val;
});
};
function createProxyMethod(Model, remotes, remoteMethod) {