Error with importing from SystemJS #953
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello.
When I tried to use this plugin I got such error.
And to eliminate this, I had to put that line in the index.js.
Because I got undefined value after importing in NgModule.
I don`t know is it a bug or I did something wrong?
can share code ??
I found a way to make it working like so :
in
app.module.tsimport * as FileUploadModuleObj from 'ng2-file-upload'; const FileUploadModule = (FileUploadModuleObj as any).default.FileUploadModule;I then can import FileUploadModule in my NgModule.
I use
(FileUploadModuleObj as any)because vscode wrongly think FileUploadModuleObj do not have an default value (and have a bunch of other value he do not really have)with this, I did not need to modify the code of the module.
the downside is that it broke all intellisense when using any part of the module, because every part must be find inder the "defaults" attribute
I finally successfully implemented the solution of zdimon :
index.js
systemjs.config.js
not sure if everything is 100% correct, but it work.