2016-10-08 7 views
1
ORIGINAL EXCEPTION: ReferenceError: Swiper is not defined 
ORIGINAL STACKTRACE: 
ReferenceError: Swiper is not defined 
    at SwiperComponent.ngOnInit (http://localhost:3000/main.bundle.js:20818:28) 
    at DebugAppView._View_Home0.detectChangesInternal (Home.ngfactory.js:8303:84) 
    at DebugAppView.AppView.detectChanges (http://localhost:3000/vendor.bundle.js:57290:15) 
    at DebugAppView.detectChanges (http://localhost:3000/vendor.bundle.js:57396:45) 

すべての処理を行った後、このエラーが表示されます。何が起こったのか理解していない。また、このGitHubリポジトリには多くのエラーがあります。angular2-useful-swiperを統合するには

https://www.npmjs.com/package/angular2-useful-swiper

+0

どれニュースを働くべきですか?私は同じエラーに直面しています。 – Sasha

答えて

1

ステップ1

...あなたの単一のページ

<link href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/css/swiper.min.css" rel="stylesheet"> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/js/swiper.js"></script> 

にSwiperを追加

Plunker Example

0

インストール

npm install --save angular2-useful-swiper 

セットアップ

あなたapp.module.tsでそれを宣言した後、あなたの単一のページ

<link href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/css/swiper.min.css" rel="stylesheet"> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/js/swiper.js"></script> 

にSwiperを追加

@NgModule({ 
    imports: [ 
     // your other imports 
     SwiperModule 
    ], 
    declarations: [ 
     // your declarations 
     DemoComponent 
    ], 
    bootstrap: [AppComponent] 
}) 

は今

https://www.npmjs.com/package/angular2-useful-swiper

関連する問題