Display items in reverse order from Firebase in ng-repeat

My issue is similar to the SO question below

Reverse order of items pulled from database in ng-repeat

HOWEVER, I am using the following method to bind all the transactions for a specific AccountID

var syncObject = $firebaseObject(fb.child("members/" + fbAuth.uid + "/accounts/" + $scope.AccountId)); syncObject.$bindTo($scope, "data");

The difference from the SO question mentioned above and mine is that I'm using the

$firebaseObject

to bind the data (three-way data binding)

So how can I show the list of transactions in reverse order? I want to show the most recent transaction at the top of the view

Thanks in advance for your help!

You should be using $firebaseArray in this case as it'll allow you to sort however you want:

Javascript

var ref = fb.child("members/" + fbAuth.uid + "/accounts/" + $scope.AccountId);

$scope.data = $firebaseArray(ref);

HTML

<div data-ng-repeat="child in data | orderBy:'FIELD_TO_SORT_BY':true>
    <!-- other elements -->
</div>