CngxFilterValueEditorHost
projects/forms/filter-builder/filter-builder-value-editor-host.directive.ts
Import#
import { CngxFilterValueEditorHost } from '@cngx/forms/filter-builder'
Description#
Mounts a registered custom value editor (CngxFilterEditorComponent)
with the documented contract actually honoured: value, fieldDef,
expression and disabled are projected onto the mounted instance, and
the instance's value model is read back into the row's write sink.
Replaces the historical bare *ngComponentOutlet branch, which mounted
the component with no inputs and no read-back - a registered editor
rendered disconnected from the expression value.
NgComponentOutlet cannot observe a mounted component's ModelSignal,
so the fix is a dedicated dynamic mount, not outlet bindings. Sync
discipline mirrors the createFieldSync bridge: one effect pushes the
host-side inputs (imperative setInput calls inside untracked()),
one effect reads instance.value() as its tracked source and calls the
sink inside untracked(). Both directions break the cycle through
valueEquals - default: arrayEqual when both sides are arrays (fresh
[min, max] / list references from between / in editors must not
defeat the guard), Object.is otherwise. Override per mount for
structured editor values.
Inputs the mounted component does not declare are skipped
(reflectComponentType gate), so a minimal editor with only the
required value model mounts cleanly.
Metadata#
Relationships
Index#
Properties
Inputs#
Editor component class resolved from the CNGX_FILTER_EDITORS registry.
{ alias: 'cngxFilterValueEditorHost', }Disabled state projected onto the editor's optional disabled input.
falseFilterExpression | undefinedFull expression node projected onto the editor's optional expression input.
FilterFieldDef | undefinedField metadata projected onto the editor's optional fieldDef input.
Instance Properties#
unknownWrite sink for editor-originated value changes (the row controller's setValue).
input<((value: unknown) => void) | undefined>(undefined)unknownCycle-break equality for the value round trip. Default: arrayEqual
when both sides are arrays, Object.is otherwise. Provide a custom
fn for structured (non-array object) editor values.
input<((a: unknown, b: unknown) => boolean) | undefined>(undefined)