我正在尝试以这种常见的方式在我的应用程序中使用 ng2-file-upload。
在我的模块中。
import { FileUploadModule } from 'ng2-file-upload';
在 systemjs 配置中。
map: {
...
'ng2-file-upload': '/static/node_modules/ng2-file-upload',
...
},
packages: {
'ng2-file-upload': {
main: 'ng2-file-upload.js',
defaultExtension: 'js'
}
}
})
SystemJS.import('main.js').then(function(m){
}, function(error){
console.log(error);
});
结果,我总是收到此错误。
Error: Unexpected value 'undefined' imported by the module 'AppModule'
但是所有的js文件都正确下载了。我还尝试了 index.js、bundles/ng2-file-upload.umd.js 没有任何效果。请问你能帮帮我吗?