Confirm Dialog
A reusable confirmation dialog built on top of Angular Material's dialog system. Let users confirm or cancel an action with a customizable title and message, and receive the result through the dialog's afterClosed() stream.
Overview
Examples
Open ConfirmDialogComponent with Angular Material's MatDialog service, passing a title and message through the data option. The dialog resolves to true when the user confirms and false when they cancel, so you can branch on the value emitted by afterClosed().
- Uses Angular Material dialog for modal presentation.
- Tree-shakable: only imported features are included in your bundle.
- Customizable title and message via dialog data.
- Follows Angular Material and WCAG accessibility best practices, with semantic HTML and ARIA attributes.
API
Inputs (via MAT_DIALOG_DATA)
| Name | Type | Description |
|---|---|---|
title | string | Dialog title |
message | string | Dialog message |
Outputs
Returns true if confirmed, false if cancelled, delivered through the dialog close result (afterClosed()).
If the dialog does not display, verify Angular Material styles are loaded and that the correct Angular version and peer dependencies are installed.
