revolunet/angular-carousel

ngRepeat controls does not correctly work with `| orderBy`

extempl opened this issue · 1 comments

Because of wrong regexp here:

var exprMatch = repeatAttribute.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),

The problem is appear here:

var canloop = ((isRepeatBased ? scope.$eval(repeatCollection.replace('::', '')).length : currentSlides.length) > 1) ? angular.isDefined(tAttributes['rnCarouselControlsAllowLoop']) : false;
var nextSlideIndexCompareValue = isRepeatBased ? '(' + repeatCollection.replace('::', '') + ').length - 1' : currentSlides.length - 1;

I've hotfixed this with var items = repeatCollection.replace('::', '').replace(/\s*\|.*/, '') on the 457th line (and replaced repeatCollection.replace('::', '') with items on 458-459 lines), but I think, this should be done in more correct way.

Seems like it is already fixed here: ac305be