Skip to main content
cngx-src documentation

CngxDialogConfig

Interface

projects/common/dialog/dialog/dialog-config.ts

Referenced by#

Import#

import { CngxDialogConfig } from '@cngx/common/dialog'

Description#

Configuration for programmatically opened dialogs.

Mirrors the declarative CngxDialog input surface - everything a template-driven dialog can bind is also reachable through CngxDialogOpener.open().

Index#

Instance Properties#

autoFocus#"first-focusable" | "none" | unknown
Optional

Focus strategy on open. Default: 'first-focusable'.

closeOnBackdropClick#boolean
Optional

Whether clicking the backdrop dismisses the dialog. Default: true.

closeOnEscape#boolean
Optional

Whether pressing Escape dismisses the dialog. Default: true.

data#D
Optional

Data to inject via CNGX_DIALOG_DATA inside the dialog component.

Optional

Initial error flag, same contract as the declarative [error] input.

focusFallback#HTMLElement
Optional

Fallback element to focus when the trigger element is gone by the time the dialog closes, same contract as the declarative [focusFallback].

Optional

External async state driving pending/error, same contract as the declarative [state] input. Takes precedence over submitAction.

submitAction#function
Optional

Async action executed when the dialog closes with a value. Same contract as the declarative [submitAction] input: on success the dialog auto-closes, on error it stays open with the error announced. The submit lifecycle is exposed on CngxDialogRef.submitState.