Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ion-slides 1.2.1 ionic. How to get active slide?

$
0
0

$ionicSlideBoxDelegate is deprecated, since it was only used for controlling ion-slide-box.
With ion-slides it works a bit different. You need to use $scope.$watch to get the slider object, then you have full access to its api (see here):

$scope.$watch("slider", function(slider){
	if (slider){
            // save it to a local variable, e.g.:
	    ctrl.slider = slider;
	}
});

Then do whatever you want, in your case:
var newIndex = ctrl.slider.activeIndex


Viewing all articles
Browse latest Browse all 228595

Trending Articles