Dialog is a static class that provides pre-configured modal dialogs based on SweetAlert2.
It offers confirm, success, error, warning, info, unknown error, and loading dialogs with Metronic-styled buttons.
Import
import {components} from 'metronic-extension';
const {Dialog} = components;
Methods
All methods are static. No instantiation is required.
Method
Return
Description
confirm(message, options?)
Promise<boolean>
Shows a confirm dialog with OK / Cancel buttons. Returns true if confirmed.
success(message, options?)
Promise<boolean>
Shows a success dialog with a notification sound. Returns true if confirmed.
error(message, options?)
Promise<void>
Shows an error dialog.
warning(message, options?)
Promise<void>
Shows a warning dialog.
info(message, options?)
Promise<void>
Shows an info dialog.
unknownError(message?, options?)
Promise<void>
Shows an error dialog with a default message: "The process was interrupted due to an error. Please try again."
loading(message, options?)
Promise<void>
Shows a loading dialog with a spinner. No close button.