This is an overview of the most common usage of AlertDialog. For more information about the available properties, methods, or events, head over to the complete API documentation for AlertDialog.
The alert()
method shows a message and an OK button. Use it to show information and notifications that do not require an action from the user.
The method is part of the dialogs
module.
The alert()
method is available globally. You can call it anywhere in your app.
alert('Your message')
.then(() => {
console.log("Alert dialog closed.");
});
alert({
title: "Your title",
message: "Your message",
okButtonText: "Your OK button text"
}).then(() => {
console.log("Alert dialog closed");
});