Open b-mi opened 6 years ago
Hello @b-mi I'll take a look, maybe a new version was released and is not backward compatible.
Hello @juan-manuel-alberro i also get an error like this, is it was resolved ? or still not yet ?
+1. Not working at all
You need to manually include sweetalert2 for this to work.
@jeffreypolk - how exactly include sweetalert2 'manually '? I use instructions for install from author - but it not work. Did you try your solution on angular 4?
Yes using Angular4. Not sure if it's the "right" way, but I just included sweetalert2 CDN js and css references in my index.html
I have the same problem like b-mi, and I think the problem come from webpack compile.
@b-mi I found that 'manual installation' means installing and adding SweetAlert2 in angular.cli.json
First Install SweetAlert2 vía npm
npm install --save sweetalert2
In your angular.cli.json
include the css and js files
"styles": [
...
"../node_modules/sweetalert2/dist/sweetalert2.min.css",
...
],
"scripts": [
...
"../node_modules/sweetalert2/dist/sweetalert2.min.js",
...
],
Now runng-serve
again, and angular-sweetalert-service
will work without problems.
Im still with the webpack warning about compatibility
Installed angular wrapper, I use angular 4, and got this error:
ERROR TypeError: myWindow.Sweetalert2 is not a function at SweetAlertService.webpackJsonp.../../../../angular-sweetalert-service/js/service/sweetalert2.service.js.SweetAlertService.confirm (sweetalert2.service.js:25)
In component code I used
Then, command from your page end with error: