As of LoopBack 2.0, there is a new method for defining remote method metadata Model.remoteMethod. To configure a prototype method, one has to supply a flag isStatic:
Model.remoteMethod('foo', { isStatic: false, ... });
A) This is inconsistent with the approach we have already in place for hooks (docs), where we prefix the method name with prototype.:
Model.beforeRemote('prototype.foo', ...);
B) The usage of this API - e.g. ('find', true) - is very ambiguous. What does true mean? One has to be very familiar with the API to understand what is the intent of such code snippet.
We should modify Model.remoteMethod to support the prototype.foo notation too.
Since both Model.remoteMethod and Model.beforeRemote are thin wrappers around strong-remoting API, we should fix this problem in strong-remoting too.
As of LoopBack 2.0, there is a new method for defining remote method metadata
Model.remoteMethod. To configure a prototype method, one has to supply a flagisStatic:A) This is inconsistent with the approach we have already in place for hooks (docs), where we prefix the method name with
prototype.:B) The usage of this API - e.g.
('find', true)- is very ambiguous. What doestruemean? One has to be very familiar with the API to understand what is the intent of such code snippet.We should modify
Model.remoteMethodto support theprototype.foonotation too.Since both
Model.remoteMethodandModel.beforeRemoteare thin wrappers around strong-remoting API, we should fix this problem in strong-remoting too.