This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ angular.module('ui.bootstrap.carousel', [])
74
74
return angular . isDefined ( slide . index ) ? + slide . index : slides . indexOf ( slide ) ;
75
75
} ;
76
76
77
- $scope . next = function ( ) {
77
+ self . next = $scope . next = function ( ) {
78
78
var newIndex = ( self . getCurrentIndex ( ) + 1 ) % slides . length ;
79
79
80
80
if ( newIndex === 0 && $scope . noWrap ( ) ) {
@@ -85,7 +85,7 @@ angular.module('ui.bootstrap.carousel', [])
85
85
return self . select ( getSlideByIndex ( newIndex ) , 'next' ) ;
86
86
} ;
87
87
88
- $scope . prev = function ( ) {
88
+ self . prev = $scope . prev = function ( ) {
89
89
var newIndex = self . getCurrentIndex ( ) - 1 < 0 ? slides . length - 1 : self . getCurrentIndex ( ) - 1 ;
90
90
91
91
if ( $scope . noWrap ( ) && newIndex === slides . length - 1 ) {
Original file line number Diff line number Diff line change @@ -436,6 +436,14 @@ describe('carousel', function() {
436
436
}
437
437
} ) ;
438
438
439
+ it ( 'should expose .next()' , function ( ) {
440
+ expect ( ctrl . next ) . toEqual ( scope . next ) ;
441
+ } ) ;
442
+
443
+ it ( 'should expose .prev()' , function ( ) {
444
+ expect ( ctrl . prev ) . toEqual ( scope . prev ) ;
445
+ } ) ;
446
+
439
447
describe ( 'addSlide' , function ( ) {
440
448
it ( 'should set first slide to active = true and the rest to false' , function ( ) {
441
449
angular . forEach ( ctrl . slides , function ( slide , i ) {
You can’t perform that action at this time.
0 commit comments