API reference¶
Functions¶
buildFormFromSchema(schema, initial?)¶
Builds a typed FormGroup from a root nodeGroup schema.
function buildFormFromSchema<S extends NodeGroup>(
schema: S,
initial?: Record<string, unknown> | null,
): DFormGroup<S>;
Parameter |
Type |
Description |
|---|---|---|
|
|
The root schema. Author it with |
|
object | |
Optional seed values, keyed by the schema’s |
Returns a FormGroup whose keys and control value types are inferred from
schema.
const form = buildFormFromSchema(profileSchema, { firstName: 'Ada' });
defineSchema(schema)¶
Identity helper that captures a schema literal with its exact type while checking
it against NodeGroup. Use it (or satisfies NodeGroup) so
buildFormFromSchema can infer a typed form. See Typed schemas.
function defineSchema<const S extends NodeGroup>(schema: S): S;
buildControl(node, initial?)¶
Builds the AbstractControl for a single node — a FormControl, FormArray, or
nested FormGroup depending on node.kind. Most code uses
buildFormFromSchema; reach for buildControl to build one non-root node.
function buildControl<T extends NodeType>(
node: T,
initial?: unknown | null,
): DFormControl<T>;
Components¶
<nff-dynamic-recursive-form>¶
DynamicRecursiveFormComponent — renders a schema against a FormGroup. Import it
into your standalone component’s imports.
<nff-dynamic-recursive-form
[schema]="schema"
[formGroup]="form"
[editable]="true"
/>
Input |
Type |
Default |
Description |
|---|---|---|---|
|
|
— |
Required. The schema to render. |
|
|
new empty group |
The form to bind to — pass the result of |
|
object |
— |
Optional seed value applied on init. Prefer seeding via |
|
|
|
Whether fields start editable. Each group also has an edit toggle. |
|
|
— |
Overrides the header title of the rendered group. |
Note
Always pass a formGroup built from the same schema with buildFormFromSchema.
Rendering with [schema] alone binds the fields to a throwaway group and the
values won’t reach your form.
<nff-config-editor>¶
ConfigEditorComponent — a tree/detail editor for large configs. The structure
(containers, lists, groups) is a tree on the left; selecting a node shows that
node’s leaf fields for editing on the right. Binds to the same FormGroup as the
form component.
<nff-config-editor [schema]="schema" [formGroup]="form" />
Input |
Type |
Default |
Description |
|---|---|---|---|
|
|
— |
Required. The schema to edit. |
|
|
— |
Required. The form from |
|
|
|
Whether the detail fields are editable. |
Types¶
The schema model. See the Schema reference for every property.
Type |
Description |
|---|---|
|
A group of fields (object). The root of a schema. |
|
A single scalar field. Union of |
|
A list of scalar fields. |
|
A list of groups. |
|
A discriminated selection ( |
|
|
|
Presentation options for a |
|
The form-value key ( |
Inferred (advanced)¶
Type |
Description |
|---|---|
|
The |
|
The control type inferred for a node |
|
Maps a leaf |