Skip to content

Instantly share code, notes, and snippets.

@SrijithRad
Last active July 5, 2016 06:08
Show Gist options
  • Save SrijithRad/cde9dcfbfb8f6566c06beeb2800f1c23 to your computer and use it in GitHub Desktop.
Save SrijithRad/cde9dcfbfb8f6566c06beeb2800f1c23 to your computer and use it in GitHub Desktop.
Implement the new ion-slides that uses the awesome SwiperJs
<div ng-controller="DemoCtrl">
<ion-slides slider="swiper" options="swiperOptions">
<ion-slide-page><h1>SLIDE 1</h1></ion-slide-page>
<ion-slide-page><h1>SLIDE 2</h1></ion-slide-page>
<ion-slide-page><h1>SLIDE 3</h1></ion-slide-page>
</ion-slides>
</div>
app.controller('DemoCtrl', function(){
$scope.swiperOptions = {
/* Whatever options */
effect: 'slide',
initialSlide: 0,
/* Initialize a scope variable with the swiper */
onInit: function(swiper){
$scope.swiper = swiper;
// Now you can do whatever you want with the swiper
},
onSlideChangeEnd: function(swiper){
console.log('The active index is ' + swiper.activeIndex);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment