Skip to content

Commit

Permalink
Swiper can be controlled by changing currentSlide
Browse files Browse the repository at this point in the history
  • Loading branch information
abrbhat committed Dec 26, 2015
1 parent cb1ab3a commit 6f40023
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/angular-swiper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/angular-swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@
});
}

$scope.$watch('currentSlide', function(newValue, oldValue){
if ((!angular.isUndefined(newValue)) && (newValue != oldValue)){
swiper.slideTo(newValue);
}
}, true);

//If specified, calls this function when the swiper object is available
if (!angular.isUndefined($scope.onReady)) {
$scope.onReady({
Expand Down

0 comments on commit 6f40023

Please sign in to comment.