Comments (9)
Subschema are currently not supported. Currently the only supported types are string, number/integer and boolean.
You could probably create a custom field type and its value accessor to be able to represent the subschema (maybe using itself a SchemaForm ).
from ngx-schema-form.
Ok, thx) I hope in the next version it will be native)
from ngx-schema-form.
Maybe I have misunderstood what you were asking.
Do you want to be able to build a form from this kind of schema ?
{
"properties": {
"name": {
"type": "string"
},
"address": {
"type": "object",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
}
}
}
}
}
with address
having its own subschema ?
from ngx-schema-form.
Yes, I want create something like in this example - http://jspears.github.io/subschema/#/Loader?_k=4hk4x7. When I click on the button "Add", shows a new form.
from ngx-schema-form.
Ok, neither arrays nor subschema are supported yet but note that if you want to display a field conditionally, you can use the showIf
property:
"properties": {
"name": {
"type": "string"
},
"showAddress": {
"type": "boolean"
},
"address": {
"type": "string",
"visibleIf": {"showAddress":[true]}
}
}
from ngx-schema-form.
Thx) I am very need in subschema for my project)
from ngx-schema-form.
As I previously said, currently nested schemas are not implemented.
You have to flatten your schema and can use fieldsets to visually organise your data.
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"properties": {
"firstName": {
"type": "string",
"placeholder": "First name",
"minLength": 2,
"maxLength": 40,
"title": "First name",
"description": "First name"
},
"inpBtn": {
"type": "inputWithButton",
"placeholder": "First name",
"minLength": 2,
"maxLength": 40,
"title": "First name",
"description": "First name"
},
"street": {
"type": "string",
"placeholder": "Street",
"title": "Street",
"description": "Street"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
}
},
"fieldsets":[{
"id": "info",
"fields":[ "firstName","inpBtn"]
},{
"id": "address",
"fields":[ "street", "city", "zip"]
}],
"required": ["street"]
}
from ngx-schema-form.
Yes, thx) I incorrectly translated your phrase))
from ngx-schema-form.
Subschemas are supported.
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.