Comments (6)
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.
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.
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.
@ebrehault is this demo still available somewhere? because the new demo is not containing this allert statement?
from ngx-schema-form.
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.
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)
- Could not resolve dependency - peer @angular/common@"^11.2.6" from [email protected]
- Parent container for all the form actions HOT 3
- [Bug]: Type mismatch with sf-form component input HOT 1
- Regression loading array data with v 2.7.0
- Visible If not working if value is [0] HOT 3
- Add support for Angular 14 HOT 2
- when adding my angular 14.0.6 project > npm install ngx-schema-form --save HOT 4
- "visibleIf" with nothing vs. "oneOf"
- Support for draft 2020-12 array syntax
- are dependent fields in JSON schema supported ? HOT 2
- visibilityIf no longer works when target is multiple Select widget HOT 2
- Type 'string' is not assignable to type 'TSchemaPropertyType | undefined' HOT 1
- Add support for Angular 15 HOT 3
- Compatibility issue with Angular version 8.2 HOT 5
- Large number input fields behaving oddly HOT 2
- Compatibility with angular 16 HOT 3
- ESM imports not working HOT 1
- undefined type "undefined" error for a valid schema HOT 1
- Issue with visibleIf in array items HOT 4
- upgrade to Angular 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-schema-form.