Firebase orderby timestamp not working

Am ordering the return item by timestamp , but it doesnt work
it return items in order of date posted ,so when new post go to bottom instead of top

this is my factory

.factory("items", function($firebaseArray) {
     var itemsRef = new Firebase("https//*****.firebaseio.com/comments");
      return itemsRef;
 })

this is my controll

.controller('streamCtrl', function($scope, items, $firebaseArray, $rootScope, $ionicModal, ionicToast, $localStorage) {
      $scope.comments = $firebaseArray(items.orderByChild("timestamp"));

this is post with the time stamp which post successfull

    $scope.comment.timestamp = Firebase.ServerValue.TIMESTAMP;

@madibaion I have the same issue. Did you figure it out in the end?

yeah ,

	  <ion-item class="item-text-wrap" collection-repeat="comment in comments |  orderBy:'-$id'">

the 14 long string you on firebase ,represent the timestamp on the date added and updated – just call firebaseAsrray then on the ng repeat directive , orderBy : '-$id"

1 Like