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

Multiple ion-slides in the same view

$
0
0

@fani wrote:

I have multiple ion-slides in the same view, but they all share the same slider of the last ion-slides. So, if I slide one of them, the bullets of the pagers don't change. If I slide the last ion-slides, all the pagers change their bullets. I tried to use a controller and the "Controller as ctrl" form, but I get the same result. How can I fix that?

<div ng-repeat="mydata">
  <div ng-controller="Controller as ctrl">
      <ion-slides   option="{pager:true}" slider="ctrl.slider">
      </ion-slided>
  </div>
</div>


.controller('Controller', ['$scope', function($scope)
  {
    var self = this;
    this.slider;
    this.activeIndex;
    this.previousIndex;


    $scope.$on("$ionicSlides.sliderInitialized", function(event, data){
      self.slider = data.slider;
    });

    $scope.$on("$ionicSlides.slideChangeStart", function(event, data){

    });

    $scope.$on("$ionicSlides.slideChangeEnd", function(event, data){
      self.activeIndex   = data.activeIndex;
      self.previousIndex = data.previousIndex;
    });
  }])

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>