Typescript
typescript . .ts :
import * as swal from 'sweetalert';
,
swal({
title: "Are you sure?",
text: "You will not be able to undo this action",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
confirmed => {
if(confirmed) {
}
});
docs.
npm
sweetalert npm
npm install sweetalert
// the old way
typings install dt~sweetalert
// new way
npm install
, js css index.html.
swal(..) is not a function
js .
CLI aurelia
aurelia.json.
{
"name": "sweetalert",
"path": "../node_modules/sweetalert",
"main": "dist/sweetalert.min",
"resources": [
"dist/sweetalert.css"
]
},
app.html
<require from="sweetalert/dist/sweetalert.css"></require>