Skip to content

New Example: Use Mongoose Schema #12

@mikeerickson

Description

@mikeerickson

I was doing some comparison between 'schema form' and 'formly' and it dawned on me, it would be nice to use an existing Mongoose schema as the source for fields, validation, etc.

Activity

kentcdodds

kentcdodds commented on May 12, 2015

@kentcdodds
Member

Totally, terrific example idea. Would probably be very similar to http://angular-formly.com/#/example/very-advanced/oim

mikeerickson

mikeerickson commented on May 12, 2015

@mikeerickson
Author

You are indeed correct, that is basically what needs to be done (using the OIM approach). I will mess around with this and see what I can come up with.

FWIW, this is a 'comparison' issue with the other tool as it is based on schema (it doesn't have Mongoose connection either so ... )

kentcdodds

kentcdodds commented on May 12, 2015

@kentcdodds
Member

I should note, that there's an entire repo already initialized to add json-schema support to angular-formly as a plugin: https://github.com/formly-js/angular-formly-json-schema

mikeerickson

mikeerickson commented on May 12, 2015

@mikeerickson
Author

Fantastic, that looks yummy!

mikeerickson

mikeerickson commented on May 12, 2015

@mikeerickson
Author

Can you please confirm contents of this repo? There are only two files (README and LICENSE) ??

kentcdodds

kentcdodds commented on May 12, 2015

@kentcdodds
Member

Yes, this is true. I started a branch a while ago in angular-formly core to add support but didn't have time to work on it. Obviously it'll be implemented a bit differently now, but here's the starting point: formly-js/angular-formly@14db781

There may be changes necessary to angular-formly to enable this, and that's fine. But I'd like it to be fairly minimal.

mikeerickson

mikeerickson commented on May 12, 2015

@mikeerickson
Author

Ahhhhh, misunderstood what you said.

kentcdodds

kentcdodds commented on May 12, 2015

@kentcdodds
Member

Nah, I still want an example of doing something like this with mongoose :-)

mikeerickson

mikeerickson commented on May 12, 2015

@mikeerickson
Author

Well, this I will do just that :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mikeerickson@kentcdodds

        Issue actions

          New Example: Use Mongoose Schema · Issue #12 · formly-js/angular-formly-website