-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the latest version cannot work in ng2+, npm install result is not complete #738
Comments
The |
I have tried use angular CLI 1.3.2 to create a clean project and npm install the latest of sweetalert. I cannot import swal and error has been displayed in the picture (after change to 2.0.3, the error was gone). Is there any change for usage for angular 2+? |
It shouldn't matter which Angular version you use since SweetAlert just uses simple ES imports. I don't see any error in your screenshots so I'm going to go ahead and close this. |
Thanks, I see the problem now. Will investigate! |
OK thanks |
Alright, I just published v2.0.5 on NPM. Try to download that and try again. Also, make sure that you add the following line in your project's "allowSyntheticDefaultImports": true, |
Thanks. I have tried it
it works perfect. But if I import it as previous:
There is still an error as follows, I think the sweetalert.d.ts should export default class swal, then the swal can be imported directly according to this microsoft/TypeScript#3337 |
same issue as @xmeng1 , only import as works |
change
|
The last version 'npm install' the package in
node_modules
is not complete:version 2.0.4
version 2.0.3
So with the latest version in Angular2+, the
swal
cannot be found and imported.The text was updated successfully, but these errors were encountered: