Last active
July 5, 2016 06:08
-
-
Save SrijithRad/cde9dcfbfb8f6566c06beeb2800f1c23 to your computer and use it in GitHub Desktop.
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