I have a method inside a typescript class that just looks like this
var confirmation = confirm("Run Agent Job?");
if (confirmation) {
console.log('yes');
} else {
console.log('no');
}
I'm trying to convert this to use Sweet Alert, so inside the method I just put this. But Typescript doesn't recognize this It throws a Cannot find name swal
swal("hello");
I have imported sweet alert as follows
<link href="~/Content/css/sweetalert.css" rel="stylesheet" />
<script src="~/Scripts/sweetalert.min.js"></script>
What am I doing wrong? If I try to use swal()
in just a plain *.js
file, it'll work fine. It's only when it's in a *.ts
file.