无法让ng2-dragula在Plunker中工作

时间:2018-05-22 15:46:59

标签: javascript angular plunker dragula ng2-dragula

我一直试图让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开发者工具中调试它会发现该对象实际上是classes package。我不完全确定它的来源,我认为这是一个需要的地方。

有解决方法吗?

Plunker

0 个答案:

没有答案