我正在尝试在我的 angular2 应用程序中使用Dragula。这是我的代码中的 app.module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { DragulaService, DragulaModule } from 'ng2-dragula/ng2-dragula';
import { AppComponent } from './app.component';
import { PlayComponent } from './play/play.component';
import {SelectedInstrumentsService} from './selected-instruments.service';
import {SizeService} from './size.service';
import {AudioFinderService} from './audio-finder.service';
@NgModule({
declarations: [
AppComponent,
PlayComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,DragulaModule
],
providers: [DragulaService,SelectedInstrumentsService,SizeService,AudioFinderService],
bootstrap: [AppComponent]
})
export class AppModule { }
不幸的是,当我添加DragulaService
到,providers
或我面临以下错误时:DragulaModule
imports
Uncaught TypeError: ctorParameters.map is not a function
at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:39645:47)
at Reflector.parameters (http://localhost:4200/main.bundle.js:39856:48)
at CompileMetadataResolver.getDependenciesMetadata (http://localhost:4200/main.bundle.js:22231:156)
at CompileMetadataResolver.getTypeMetadata (http://localhost:4200/main.bundle.js:22196:26)
at CompileMetadataResolver.getDirectiveMetadata (http://localhost:4200/main.bundle.js:21969:28)
at http://localhost:4200/main.bundle.js:22038:49
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/main.bundle.js:22031:44)
at http://localhost:4200/main.bundle.js:22019:50
at Array.forEach (native)
我确定,我已经dragula
正确安装了。