angularjs-sweetalert2
v1.0.0
Published
AngularJS wrapper for SweetAlert2
Downloads
199
Maintainers
Readme
AngularJS wrapper for SweetAlert2
AngularJS wrapper for SweetAlert2. Sweet Alert is a beautiful replacement for Javascript's "Alert".
Usage
SweetAlert2.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
Demo
http://recepuncu.github.io/ngSweetAlert2/
Dependencies
- required:
AngularJS
sweetalert2
Install
- download the files
- Bower
- add
"angular-sweetalert2": "latest"
to yourbower.json
file then runbower install
OR runbower install angular-sweetalert2
- add
- Bower
- include the files in your app
SweetAlert2.min.js
sweetalert2.min.js"
sweetalert2.min.css
- include the module in angular (i.e. in
app.js
) -recepuncu.ngSweetAlert2