ng-xtend API documentation
    Preparing search index...

    Type Alias XtContext<T>

    A XtContext provides all the necessary information for an ng-extended component to operate. It is passed from parent to child component and pass

    • The display mode - View, Inline view or Edit
    • The value, either directly as a signal or in a formgroup when editing.
    • The valueType, necessary to find the right ng-extended component to display

    To do this, it maintains a hierarchy of context and subContexts by name.

    type XtContext<T> = {
        displayMode: XtDisplayMode;
        displayValue: Signal<T | null>;
        listActions: WritableSignal<XtAction<T>[] | null>;
        localFormGroup?: FormGroup;
        parentContext?: XtContext<any>;
        parentFormGroup?: FormGroup;
        reference?: XtTypeReference;
        referencedContext?: XtContext<any>;
        subName?: string;
        valueType?: string;
        elementSetContext(subElement: any): XtContext<any>;
        formControlNameOrNull(): string | null;
        formControlValue(): any;
        formGroup(): FormGroup<any> | undefined;
        isInForm(): boolean;
        isReference(): boolean;
        setDisplayValue(
            newValue: T | null | undefined,
            type?: string,
        ): XtContext<T>;
        setFormValue(
            newValue: T | null | undefined,
            markAsDirty?: boolean,
        ): boolean;
        setReferenceInfo(ref: XtTypeReference): void;
        subContext(
            subName: string | null | undefined,
            subType?: string,
            typeResolver?: XtTypeResolver | null,
        ): XtContext<any>;
        subValue(subName?: string): T | null | undefined;
        toString(): string;
        value(): T | null | undefined;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Properties

    displayMode: XtDisplayMode
    displayValue: Signal<T | null>
    listActions: WritableSignal<XtAction<T>[] | null>
    localFormGroup?: FormGroup
    parentContext?: XtContext<any>

    Signal when all the asynchronously defined subreferences are resolved.

    subReferencesResolved: WritableSignal;

    parentFormGroup?: FormGroup
    reference?: XtTypeReference

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

    referencedContext?: XtContext<any>

    If it's a reference, we keep the context referenced

    subName?: string
    valueType?: string

    Methods