@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Reference to an open modal dialog.

    Returned by ModalService.openModal and injected into the content component. The opener subscribes to closed to receive the result; the content component calls close to dismiss the dialog.

    // Inside a modal content component
    readonly modalRef = inject(ModalRef<string>);

    save(): void {
    this.modalRef.close(this.form.value.name);
    }

    Type Parameters

    • R = unknown
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    closed: Observable<R | undefined> = ...

    Observable that emits the result value when the modal closes, then completes. Emits undefined when closed without a result (e.g. Escape key or backdrop click).

    Accessors

    • get isClosed(): boolean

      Whether the modal has already been closed.

      Returns boolean

    Methods

    • Close the modal, optionally returning a result value to the opener.

      Parameters

      • Optionalresult: R

      Returns void