AngularJS wrapper for SweetAlert built with Promises. Sweet Alert is a beautiful replacement for Javascript's "Alert".
- required:
AngularJS
sweetalert
- download the files
- Bower
bower install angular-sweetalert-as-promised
- Bower
- include the files in your app
Alert.min.js
sweet-alert.js
ORsweet-alert.min.js
sweet-alert.css
- include the module in angular (i.e. in
app.js
) -jutaz.ngSweetAlertAsPromised
SweetAlert.success({
message: "Here's a message"
}).then(function () {
// User closed alert
});
SweetAlert.warning({
message: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!"
}).then(function () {
// User accepted
}, function () {
// User declined
});