You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share method source code between angular service and loopback server #24
This really is an open question, I am currently having some business logic that I would like to use client side (for display purpose or "show before saving" purpose), and the same business logic would be used server side on the same loopback model instances; for validation / testing purpose.
What I would love to have, is some method available on my Loopback model instances, and have the same method provided on the object given by the generated angular service.
The aim is to have these functions directly on the object and be able to execute them without any remote call (it is only computing functions) both client & server side.
To be clear, I understand and already used remote methods, but I do not want the client to make a server request for these basics functionnalities.
We are working on this. The idea is to run loopback in the browser and share your models. You'll be able to attach models to local storage data sources and loopback servers. If you want to try this out now, take a look at the branches in the loopback project. Keep in mind these aren't released, but are working fairly well so far.
Thanks for your answer, I will take a look. If I understand well, you want to provide offline support for loopback app that would sync back when getting online? (Otherwise I do not see the use for local storage)
changed the title [-]Question or Feature? Best way to share local (not remote) method between angular service and loopback server[/-][+]Share method source code between angular service and loopback server[/+]on May 14, 2014
Activity
ritch commentedon Mar 4, 2014
We are working on this. The idea is to run loopback in the browser and share your models. You'll be able to attach models to local storage data sources and loopback servers. If you want to try this out now, take a look at the branches in the loopback project. Keep in mind these aren't released, but are working fairly well so far.
Cadrach commentedon Mar 4, 2014
Thanks for your answer, I will take a look. If I understand well, you want to provide offline support for loopback app that would sync back when getting online? (Otherwise I do not see the use for local storage)
bajtos commentedon Mar 24, 2014
See #25 for a pull request adding support for sharing the code between the client and the server.
Yes, that's part of the plan.
[-]Question or Feature? Best way to share local (not remote) method between angular service and loopback server[/-][+]Share method source code between angular service and loopback server[/+]bajtos commentedon Apr 19, 2018
This is no longer a feature we would like to pursue.