Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

$ionicSlides.slideChageStart and $ionicSlides.slideChageEnd events not working

$
0
0

@wallworth wrote:

I have been trying to implement a slider from the documentation and I am trying to detect when a slide change

The event handlers doesn't seem to fire for
"$ionicSlides.slideChangeStart"
and
"$ionicSlides.slideChangeEnd"

.controller('TutorialCtrl', function($scope, $ionicSlideBoxDelegate) {
$scope.options = {
loop: false,
effect: 'fade',
speed: 500,
}

$scope.$on("$ionicSlides.sliderInitialized", function(event, data){
// data.slider is the instance of Swiper
$scope.slider = data.slider;
});

$scope.$on("$ionicSlides.slideChangeStart", function(event, data){
console.log('Slide change is beginning');
});

$scope.$on("$ionicSlides.slideChangeEnd", function(event, data){
// note: the indexes are 0-based
console.log('Slide change is beginning');

$scope.activeIndex = data.activeIndex;
$scope.previousIndex = data.previousIndex;

});

})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles