ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

Use initialSlide: $scope.initialSlide #42

Open taylormaster opened 8 years ago

taylormaster commented 8 years ago

Hi! Clear all attribute. I do not change from controller the initialSlide value. Always jump it to the first slide.

<ks-swiper-container on-ready="onReadySwiper(swiper)">
      <ks-swiper-slide class="swiper-slide" ng-repeat="todo in todos track by $index">
        <div class="imgclass-container">
          <img class="imgclass" ng-src="{{todo.pix_url}}">
        </div>
      </ks-swiper-slide>            
    </ks-swiper-container>

and controller:

**$scope.n = 3;** 
var params = {
    slidesPerView: $scope.slidesPerView || 1,
    slidesPerColumn: $scope.slidesPerColumn || 1,
    spaceBetween: $scope.spaceBetween || 0,
    direction: $scope.direction || 'horizontal',
    loop: $scope.loop || false,
    **initialSlide: $scope.n || 0,**
    showNavButtons: true
};

or how to?

brh55 commented 8 years ago

Have you solve this issue? @taylormaster