[英]ng2-file-upload with Angular 4 and SystemJS
我正在嘗試以這種常見方式在我的應用程序中使用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,但沒有任何效果。 請問你能幫幫我嗎?
為了消除這種情況,我不得不將該行放入index.js中。
Object.defineProperty(exports, "__esModule", { value: true });
我不知道這是一個錯誤還是做錯了什么?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.