FuseConfirmationService is a singleton service for creating confirmation and information dialogs. Internally it uses MatDialog to create and show the dialog.
Here is the interface for the Confirmation configuration:
| Name | Description |
|---|---|
|
title
|
Title of the confirmation dialog, HTML is allowed. |
|
message
|
Message of the confirmation dialog, HTML is allowed. |
|
icon.show
|
Whether to show the icon. |
|
icon.name
|
Name of the icon. |
|
icon.color
|
Color of the icon. |
|
actions.confirm.show
|
Whether to show the confirmation button. |
|
actions.confirm.label
|
Label of the confirmation button. |
|
actions.confirm.color
|
Color of the confirmation button. |
|
actions.cancel.show
|
Whether to show the cancel button. |
|
actions.confirm.label
|
Label of the cancel button. |
|
dismissible
|
Sets the dismissible status of the confirmation dialog. If false, confirmation dialog cannot be closed by clicking on backdrop or pressing Escape key.
The close button on the top right corner also won't show up.
|
Since FuseConfirmationService uses MatDialog behind the scenes, it returns
a reference to the created dialog. You can use all available methods from that reference such as
updateSize and updatePosition to further customize the dialog.
See https://material.angular.io/components/dialog/api#MatDialogRef for the complete list of available methods.
Using the reference, you can also access to the user input:
| Result | Description |
|---|---|
'confirmed' |
This is the result if the user pressed the Confirm button. |
'cancelled' |
This is the result if the user pressed the Cancel button. |
undefined |
This is the result if the confirmation dismissed either using the close button, clicking on the backdrop or pressing the Escape key. |