S
S
Sn0wSky2017-02-26 13:34:00
Angular
Sn0wSky, 2017-02-26 13:34:00

Why don't filters work in angularjs in limitTo->orderBy order?

<div ng-repeat="file in floorMarketingMaterials.corporate | limitTo: MMCorporateLimit as MMCorporateResults | orderBy:['-isPinned',MMCorporateSort]">...</div>

The bottom line is that they work in reverse order (first orderBy, then limitTo), but, let's say, when you see 5 elements out of 50 due to limitTo, and you start changing MMCorporateSort, it sorts all 50 elements and shows the first 5 of them And I need to sort only the visible elements.
But when I swap orderBy and limitTo (and get what's in the paste above) it doesn't show the elements.
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sn0wSky, 2017-02-26
@Sn0wSky

The problem was in "as MMCorporateResults"
Probably, orderBy should have been somehow based on MMCorporateResults, but I didn't figure out exactly how, I did without it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question