Model Form Sub
The `base-model-form-sub component is a subcomponent used within a larger form structure. It dynamically generates form fields based on the specified GraphQL types and configuration. It supports various field types such as strings, enums, images, uploads, references, booleans, long texts, floats, passwords, colors, URLs, and date-time inputs.
Usage
Include the <base-model-form-sub> tag in your Angular templates to use the component within a larger form. Pass the necessary inputs such as parentKey, fields, config, and the form instance. Handle events emitted by the component, such as imageChanged and `fileChanged, as needed.
<base-model-form-sub
[parentKey]="parentKey"
[fields]="fieldsObject"
[config]="configObject"
[form]="formInstance"
(imageChanged)="handleImageChange($event)"
(fileChanged)="handleFileChange($event)"
></base-model-form-sub>
Notes
- The component dynamically generates form fields based on the provided GraphQL types and configuration.
- It supports complex field types such as subfields, enums, strings, images, uploads, references, booleans, long texts, floats, passwords, colors, URLs, and date-time inputs.
- The component uses the AuthService to check user roles for field visibility.