Implement the new ion-slides that uses the awesome SwiperJs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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