File

projects/ui-kit-lib/src/lib/v2/modals/dialog-content-directives.ts

Description

Button-like directive that closes the nearest dialog when clicked.

Usage:

  • It tries to inject the current MefDevDialogRef; if not available, it finds the nearest dialog container in the DOM and resolves the ref from MDDialog.openDialogs.
  • On click, it calls _closeDialogVia with an interaction origin ('mouse' or 'keyboard') so the focus can be restored appropriately.

Implements

OnInit OnChanges

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor()

Inputs

aria-label
Type : string

Optional aria-label for the closing button.

md-dialog-close
Type : any

Preferred input for a close result (dash-cased attribute).

mdDialogClose
Type : any

CamelCased alias of the same input (kept for API parity & template style).

type
Type : "submit" | "button" | "reset"
Default value : 'button'

Native button type; defaults to "button" to avoid accidental form submit.

Methods

_onButtonClick
_onButtonClick(event: MouseEvent)

Click handler: close the dialog and tag the interaction origin for focus restoration.

Parameters :
Name Type Optional
event MouseEvent No
Returns : void

Properties

dialogRef
Type : unknown
Default value : inject<MefDevDialogRef<any>>(MefDevDialogRef, {optional: true})!

Injected dialog ref when available (undefined if used outside projected dialog content).

results matching ""

    No results matching ""