DfAddonSlot
@ng-forge/dynamic-forms
Dispatcher component that renders an addon by looking up its kind in
ADDON_KIND_REGISTRY"> and instantiating the registered component.ADDON_KIND_REGISTRY
Used by every adapter's field component to render slot content:
\@for (a of addonsAt('prefix'); track $index) {
<df-addon-slot [addon]="a" />
}Behaviour:
- Resolves and caches the kind's component asynchronously on first render.
- Forwards the slot HTML attribute on the host so Ionic shadow-DOM
projection works (<ion-input> projects children with slot="start"
into its native start slot).
- Honours the addon's reactive hidden flag — when true, the host is
display: none so it occupies no layout but stays in DOM (cheaper than
tearing down the component).
- Forwards className to the host element.
- ARIA semantics are owned by individual kind components — decorative
kinds (icons, text) set aria-hidden="true" on themselves; interactive
kinds (buttons) handle their own aria-label.
If the kind cannot be resolved (registry miss, load failure), the dispatcher logs a warning and renders nothing — never throws. The runtime addon validator should have caught unknown kinds at config init, but this provides a defence-in-depth fallback for misconfigured registries.
Signature
class DfAddonSlotProperties
| Name | Type | Description |
|---|---|---|
addon | InputSignal<AnyAddon> | - |
fieldInputs | InputSignal<WrapperFieldInputs | undefined> | Optional read-only view of the host field's mapped inputs — same shape
wrappers receive (
|
hidden | InputSignal<Signal<boolean> | undefined> | Pre-resolved |
slotAttr | Signal<AddonSlot> | slot HTML attribute forwarded to host — needed for Ionic shadow projection. |
className | Signal<string | null> | - |
isHidden | Signal<boolean> |
|
resolvedComponent | Signal<Type<unknown> | undefined> | Resolved kind component — composed declaratively from two sources of
truth: the registry's synchronous cache (warm hits, e.g., a second
|
kindInputs | Signal<{ addon: AnyAddon; fieldInputs: WrapperFieldInputs | undefined; }> | Inputs passed to the kind component — addon plus the wrapper-style host bag. |
packages/dynamic-forms/src/lib/components/df-addon-slot.component.ts:40