Skip to content

Share method source code between angular service and loopback server #24

Closed

Description

@Cadrach

Hi,

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.

Activity

  1. ritch commented on Mar 4, 2014

    @ritch
    Member

    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.

  2. Cadrach commented on Mar 4, 2014

    @Cadrach
    Author

    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)

  3. bajtos commented on Mar 24, 2014

    @bajtos
    Member

    See #25 for a pull request adding support for sharing the code between the client and the server.

    If I understand well, you want to provide offline support for loopback app that would sync back when getting online?

    Yes, that's part of the plan.

  4. self-assigned this
    on Mar 24, 2014
  5. 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
  6. bajtos commented on Apr 19, 2018

    @bajtos
    Member

    This is no longer a feature we would like to pursue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions