I am looping over an array of objects in Angular JS. I have multiple filters applied and I am also using ngInfiniteScrolling for lazy load. Everything works fine except I can't use any sorting. Whatever orderBy
I apply nothing changes at all. Here's my code:
<div infinite-scroll='loadMoreFilter()' infinite-scroll-distance='0' ng-show="showFilter">
<div class="row" ng-repeat="product in (productsFiltered = (products | filter: { Prdha : filterBrand } | filter : { Matkl : filterCategory.categoryCode } | filter : { Pltyp : filterCatalogue } | filter : { inWishlist : filterFavorites } | filter : hideNA() )) | limitTo:totalDisplayed" ng-if="$index % 4 == 0">
<!-- some code -->
</div>
</div>
If I add | orderBy : myField
after the last filter (before the limitTo) nothing changes, it's like the sorting is not applied. Does anyone have any idea?