To try to solve the main question:
What is the relationship between circuitry and form?
To make things simple, it might be easiest to think of it this way. To create a form, you have three parts of JSON:
JSON containing the actual data submitted through your form. This is a model .
JSON schema . This describes the structure of the model . To give an extremely simple example of the relationship between model and schema , imagine that your actual data (your model ) describes the person in terms of their gender and age, for example {sex: female, age: 32} . The role of schema is to describe the structure of the model, so in this case it would describe that there must be a sex property of a string type whose values โโcan only be male or female , and that there is an age property, etc. To be able to submit a form filled with your model data, it just needs to have a schema to build the form in the first place.
JSON form is what I consider optional . You should have it, but it may just contain a "*" , which tells angular-schema-form simply create the form automatically based on the schema. In this case, the library will build a form completely based on the scheme, and using the default settings, as described in the documentation. But what you can do if you want, uses the form object to describe how you want to structure your form.
Here a very crude and very simple example of the flexibility of a form object gives you:
Taking an example of the person object above, if you are not using a form object (that is, it just contains a "*" ), then angular-schema-form build you a form based on the schema. So he would have input fields for sex and age . These fields may or may not be in format or order or have other properties that you want. Then you can optionally use the form object to instruct angular-schema-form how you want it to create the form. For example, you can use form to make it so that the form contains only a field for age , not sex .
So, model is your data, and schema describes the structure of this data. In a simplified form, form provides an additional layer of display and configuration to your form, overriding the default form, which will be created only based on schema .
Does it help?
source share