Coder Social home page Coder Social logo

Comments (6)

ebrehault avatar ebrehault commented on May 30, 2024

Is there a way to submit the form back to the server?

Yes of course (that's basically what everybody would expect from a form lib, right :) ), you just need to implement an action for that.
If you consider the demo, here https://github.com/makinacorpus/angular2-schema-form/blob/master/demo/app.component.ts#L83 we define an action, which just does an alert, but it could also call the http service to post the data to a backend.

Is there any way of binding the inputs?

the model is bound, so you do get the input values that way

Also does this support [enum]?

we do not support the basic enum usage, we prefer oneOf as it allows to specify value/label pairs, example: https://github.com/makinacorpus/angular2-schema-form/blob/master/demo/sampleschema.json#L86

from ngx-schema-form.

estradamarkie avatar estradamarkie commented on May 30, 2024

Thanks, yeah ofc that's what everybody expect haha just didn't realise that the action button is within the schema as well. Just looked at the demo and seems pretty clear :)

Model: do I need to use [model]=""?

Enum: I see, I don't think I will be able to change how the data is as its all coming from the back-end people and its all being generated by Swagger. Is there any work-around to this by any chance?

And $ref: #/definition/object is not supported as well?

from ngx-schema-form.

ebrehault avatar ebrehault commented on May 30, 2024

In your app, you are free to perform any changes on the data you receive from your backend.
So if your backend use regular enum, you can process it in your subscribre() to turn it into oneOf and then pass it to the schema-form component.
The same goes with $ref: you can read its value, resolve it to get the corresponding schema and inject it in the schema you pass to the form.

from ngx-schema-form.

marc101101 avatar marc101101 commented on May 30, 2024

@ebrehault is this demo still available somewhere? because the new demo is not containing this allert statement?

from ngx-schema-form.

marc101101 avatar marc101101 commented on May 30, 2024

What I do:
<sf-form [schema]=config_json_schema.schema [model]=config_json_schema.model></sf-form>
What I want:
I want the "changed" model back by clicking a submit button.

from ngx-schema-form.

ebrehault avatar ebrehault commented on May 30, 2024

The demo has been moved in ./tests. The code you are talking about is here:
https://github.com/makinacorpus/angular2-schema-form/blob/master/tests/src/app/app.component.ts#L101.

I am not sure how you want to do it, but I would store the changed schema directly in this.config_json_schema.schema, so you can access anytime.

from ngx-schema-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.