ng-xtend API documentation
    Preparing search index...

    Class XtBaseContext<T>

    Base implementation of the XtContext interface. Manages display mode, form integration, child context hierarchy, and value tracking for an ng-extended component.

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Properties

    displayMode: XtDisplayMode = 'FULL_VIEW'

    The current display mode for this context. Defaults to FULL_VIEW.

    displayValue: Signal<T | null> = ...

    Computed signal that returns the current display value from non-form storage.

    localFormGroup?: FormGroup<any>

    localFormGroup exists only for composite components: it's children are all gathered in a form group

    nonFormValue?: WritableSignal<T | null>

    When not managed by a form, the value is here

    parentContext?: XtBaseContext<any>

    When the context is a child, it potentially needs to update its parent value

    parentFormGroup?: FormGroup<any>

    The parent FormGroup when this context is a child within a reactive form.

    reference?: XtTypeReference

    When the value in the context is a reference to another type

    subName?: string

    When editable, the value is stored in a parent formGroup

    valueType?: string

    The type identifier for the value contained in this context.

    Methods

    • Sets the display value for this context when not managed by a reactive form. Propagates changes to child contexts and optionally notifies the parent context.

      Parameters

      • newValue: T | null | undefined

        The new value to set

      • Optionaltype: string

        Optional type identifier to assign

      • updateParent: boolean = true

        Whether to propagate the change to the parent context (default true)

      Returns XtBaseContext<T>

      This context instance for chaining

    • Sets the value in the parent form group for this context's sub-name.

      Parameters

      • newValue: T | null | undefined

        The new value to set on the form control

      • markAsDirty: boolean = false

        Whether to mark the control as dirty (default false)

      Returns boolean

      True if the value was successfully set

    • Returns or creates a child context for the given sub-name. Resolves type information and references when a typeResolver is provided.

      Parameters

      • subName: string | null | undefined

        The sub-name for the child context

      • OptionalsubType: string

        Optional type hint for the child

      • OptionaltypeResolver: XtTypeResolver | null

        Optional type resolver for resolving sub-types and references

      Returns XtContext<any>

      The child XtContext

    • Returns a sub-value by name from the current value object.

      Parameters

      • OptionalsubsubName: string

        Optional sub-key to retrieve from the value object

      Returns any

      The sub-value or the full value if no key is given