WrapperTypeDefinition
@ng-forge/dynamic-forms
Configuration interface for registering wrapper types.
Defines how a wrapper component is loaded and identified. Wrapper components provide visual decoration around field content (sections, headers, styling) without affecting the form data structure.
Signature
interface WrapperTypeDefinition<
T extends WrapperConfig = WrapperConfig
>Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | WrapperConfig | WrapperConfig | - |
Properties
| Name | Type | Description |
|---|---|---|
wrapperName | string | Unique identifier for the wrapper type (also serves as discriminant from FieldTypeDefinition) |
_wrapper ? | T | Wrapper definition type marker (internal use) |
loadComponent | LazyComponentLoader<unknown> | Function to load the wrapper component (supports lazy loading). Returns a Promise that resolves to the component class or module with default export. |
types ? | readonly string[] | Field types this wrapper should auto-apply to. When a field's |
Examples
const SectionWrapper: WrapperTypeDefinition = {
name: 'section',
loadComponent: () => import('./section-wrapper.component').then(m => m.SectionWrapperComponent),
};packages/dynamic-forms/src/lib/models/wrapper-type.ts:58