0

我正在尝试以这种常见的方式在我的应用程序中使用 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 没有任何效果。请问你能帮帮我吗?

4

1 回答 1

0

为了消除这种情况,我不得不将该行放在 index.js 中。

Object.defineProperty(exports, "__esModule", { value: true });

我不知道这是一个错误还是我做错了什么?

于 2018-01-03T14:12:32.540 回答