user5397525
user5397525

Reputation:

Ionic slides (ion-slides) : hide pagger when reaching the end

I am using ionic slides and I want to hide the pager when the user reaches the last slide. There is a showPagger() method but I cannot figure out how to use it for this purpose.

Any help on this?? Thanks

Upvotes: 1

Views: 995

Answers (2)

user5397525
user5397525

Reputation:

Unfortunately, after searching and searching I found out that it is an open issue about it in ionic repository. The showPager property is not exposed to the directive API, so there is no direct use to it.

Upvotes: 0

Grégoire Motot
Grégoire Motot

Reputation: 947

html :

<ion-slides pager (change)="onSlideChanged()">
  ...
<ion-slides>

js :

 $scope.onSlideChanged = function() {  
    if ($ionicSlideBoxDelegate.currentIndex() == $ionicSlideBoxDelegate.slidesCount()) {
      $ionicSlideBoxDelegate.showPager(false);
    }
    else {
      $ionicSlideBoxDelegate.showPager(true);
    }
}

I will update answer later.

Upvotes: 1

Related Questions