@jsonforms/angular package provides Angular components for integrating JSON Forms into Angular applications. These components handle form rendering, state management, and data binding.
JsonForms
The main component for rendering a complete JSON Form. This is the root component that should be used in your Angular templates.Selector
Inputs
The data to be rendered by the form. This should match the structure defined in your JSON Schema.
The JSON Schema describing the data structure and validation rules.
The UI Schema defining how the form should be rendered. If not provided, a default UI schema will be generated from the JSON Schema.
Array of renderer registrations that define which components handle which UI schema elements.
Array of UI schema registrations for dynamic schema resolution.
When true, all form controls will be rendered in read-only mode.
Controls when validation errors are displayed. Options:
'ValidateAndShow', 'ValidateAndHide', 'NoValidation'.Custom AJV instance for validation. If not provided, a default instance will be created.
Global configuration object that can be accessed by all renderers.
Internationalization configuration including locale, translate function, and error translation.
Additional validation errors to display alongside schema validation errors.
Custom middleware function for intercepting and modifying core state updates.
Outputs
Emitted when the form data changes. The event contains the updated data.
Emitted when validation errors change. The event contains the current array of validation errors.
Example
JsonFormsOutlet
A directive component used internally by JsonForms for rendering UI schema elements. Can also be used directly for advanced use cases.Selector
Inputs
Renderer properties including schema, uischema, and path.
UnknownRenderer
Fallback component displayed when no suitable renderer is found for a UI schema element.Base Classes
JSON Forms Angular provides base classes for creating custom renderers.JsonFormsBaseRenderer
Abstract base class for all renderers.Inputs
The UI schema element to render.
The JSON schema for this element.
The data path to the element being rendered.
JsonFormsControl
Base class for control renderers that handle form inputs.data: Current control valuelabel: Computed label for the controlerrors: Validation error messageenabled: Whether the control is enabledform: Angular FormControl instanceonChange(event): Method to handle value changes
JsonFormsAbstractControl
Lower-level base class for control renderers with more customization options.Inputs
Control identifier for accessibility.
Whether the control should be disabled.
Whether the control should be visible.
Module Import
To use JSON Forms Angular components, import theJsonFormsModule in your Angular module:
Make sure to provide renderers to the
JsonForms component. Without renderers, no UI will be displayed.