Scroll infini avec Angular

Par intelligid, il y a 10 ans


Bonjour, je cherche à faire un scroll infini avec angular.

Ce que je fais

J'utilise un ng-repeat:

<div ng-repeat="post in posts"> ... </div>

Cependant, il faut trier par id et en sens inverse, je fais donc

<div ng-repeat="post in posts | orderBy: 'id':true"> ... </div>

Mais orderBy ne fonctionne qu'avec des tableaux et posts est un object( tableau associant l'id d'une publication à la publication).

Comment je pourrais faire pour trier posts?

PS: Posts est chargé via une requête AJAX

1 réponse