私はangle-cliとwebpackを使用して、angle2モジュールを使用しています(angular2-swiperという外部angle2モジュールを使用しています)。Angular2モジュールはサーバが稼働した後でのみ利用可能です
私はKSSwiperModuleと呼ばれる私のAppModuleにモジュールをインポートすることが、私は私のコードで私のサーバーを起動しようとすると、それは私にエラーを与える: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: KSSwiperModule is not an NgModule
しかし、私はこのの輸入なしで実行した場合モジュールは、サーバーが実行され、私はそれが実行された後にインポートを置く、それはエラーを与えず、完全に実行します。 (いいえ、私のアプリはこのモジュールなしでは動作しません)。
マイコード:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {KSSwiperModule} from 'angular2-swiper';
import { AppComponent } from './app.component';
import { SwiperComponent } from './swiper.component';
import { AppRoutingModule } from './app-routing.module';
import { FlickityComponent } from "./flickity.component";
@NgModule({
declarations: [
AppComponent,
SwiperComponent,
FlickityComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
AppRoutingModule,
KSSwiperModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
それが起こって、どのようにそれを処理するためだ、なぜ誰かが知っていますか?