0

我一直在尝试ng2-dragula在 Plunker 工作,但它并不完全在那里。

这是我的config.js。请暂时忽略不整洁的代码。我已经明确设置了 Angular 和 RxJs 版本,因为最新版本不能很好地相互配合。

var angularVersion;
if (window.AngularVersionForThisPlunker === 'latest'){
  angularVersion = ''; //picks up latest
}
else {
  angularVersion = '@' + '5.2.11';
}

System.config({
  //use typescript for compilation
  transpiler: 'typescript',
  //typescript compiler options
  typescriptOptions: {
    emitDecoratorMetadata: true
  },
  paths: {
    'npm:': 'https://unpkg.com/'
  },
  //map tells the System loader where to look for things
  map: {
    'app': './src',
    '@angular/core': 'npm:@angular/core'+ '@5.2.11' + '/bundles/core.umd.js',
    '@angular/common': 'npm:@angular/common' + '@5.2.11' + '/bundles/common.umd.js',
    '@angular/common/http': 'npm:@angular/common' + '@5.2.11' + '/bundles/common-http.umd.js',
    '@angular/compiler': 'npm:@angular/compiler' + '@5.2.11'  + '/bundles/compiler.umd.js',
    '@angular/platform-browser': 'npm:@angular/platform-browser' + '@5.2.11' + '/bundles/platform-browser.umd.js',
    '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic' + '@5.2.11' + '/bundles/platform-browser-dynamic.umd.js',
    '@angular/http': 'npm:@angular/http' + '@5.2.11' + '/bundles/http.umd.js',
    '@angular/router': 'npm:@angular/router' + '@5.2.11' +'/bundles/router.umd.js',
    '@angular/forms': 'npm:@angular/forms' + '@5.2.11' + '/bundles/forms.umd.js',
    '@angular/animations': 'npm:@angular/animations' + '@5.2.11' + '/bundles/animations.umd.js',
    '@angular/platform-browser/animations': 'npm:@angular/platform-browser' + '@5.2.11' + '/bundles/platform-browser-animations.umd.js',
    '@angular/animations/browser': 'npm:@angular/animations' + '@5.2.11' + '/bundles/animations-browser.umd.js',

    '@angular/core/testing': 'npm:@angular/core' + '@5.2.11' + '/bundles/core-testing.umd.js',
    '@angular/common/testing': 'npm:@angular/common' + '@5.2.11' + '/bundles/common-testing.umd.js',
    '@angular/common/http/testing': 'npm:@angular/common' + '@5.2.11' + '/bundles/common-http-testing.umd.js',
    '@angular/compiler/testing': 'npm:@angular/compiler' + '@5.2.11' + '/bundles/compiler-testing.umd.js',
    '@angular/platform-browser/testing': 'npm:@angular/platform-browser' + '@5.2.11' + '/bundles/platform-browser-testing.umd.js',
    '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic' + '@5.2.11' + '/bundles/platform-browser-dynamic-testing.umd.js',
    '@angular/http/testing': 'npm:@angular/http' + '@5.2.11' + '/bundles/http-testing.umd.js',
    '@angular/router/testing': 'npm:@angular/router' + '@5.2.11' + '/bundles/router-testing.umd.js',
    'tslib': 'npm:tslib@1.6.1',
    'rxjs': 'npm:rxjs@5.5.10/',
    'rxjs/operators': 'npm:rxjs@5.5.10/operators.js',
    'typescript': 'npm:typescript@2.2.1/lib/typescript.js',
    'dragula': 'npm:dragula',
    'ng2-dragula': 'npm:ng2-dragula',
    'contra': 'npm:contra',
    'crossvent': 'npm:crossvent',
    'atoa': 'npm:atoa',
    'ticky': 'npm:ticky',
    'custom-event': 'npm:custom-event'
  },
  //packages defines our app package
  packages: {
    app: {
      main: './main.ts',
      defaultExtension: 'ts'
    },
    'rxjs': { defaultExtension: 'js' }
  }

我还添加了一些更多的包,contra因为它在控制台中抛出错误,我认为dragula. 问题是在dragula.js中,它需要它自己的./classes

在 Chrome 开发者工具中调试它显示该对象实际上是这个类包。我不完全确定这是从哪里来的,我认为它是某个地方需要的包。

有没有解决的办法?

普朗克

4

0 回答 0