1

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

push in reverse order

this is my factory

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

this is my controller

.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;

0 Answers0