Instantly share code, notes, and snippets.

Embed
What would you like to do?
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