Swiper in Ionic2 throws console error "params[param] is null"

We use Swiper 3.1.2 from http://www.idangero.us/swiper/ in Ionic 2. You can use this in your app without importing anything.

Ionic 2 Source Files:

https://github.com/driftyco/ionic2/blob/master/ionic/components/slides/swiper-widget.ts
https://github.com/driftyco/ionic2/blob/master/ionic/components/slides/slides.ts

Example Slides with images:

https://github.com/driftyco/ionic2/blob/master/ionic/components/slides/test/basic/main.html
https://github.com/driftyco/ionic2/blob/master/ionic/components/slides/test/basic/index.ts

The conference app is using this at the very beginning (all related code is in the tutorial directory):

https://github.com/driftyco/ionic-conference-app/tree/master/www/app/tutorial

So you can pass your options to the slider in options

<ion-slides pager [options]="extraOptions" (slideChanged)="onSlideChanged($event)">

JS:

    this.extraOptions = {
      loop: 'true',
      pagination: '.swiper-pagination',
      nextButton: '.swiper-button-next',
      prevButton: '.swiper-button-prev',
      paginationClickable: true,
      spaceBetween: 30,
      centeredSlides: true,
      autoplay: 100,
      autoplayDisableOnInteraction: false
    }
2 Likes