Scouring for an answer online and none of the solutions seem to work that I have found so far. I have a Python script which uses push() to enter in new entries into my Firebase. From what I read it creates a unique ID which includes a datetime stamp so it will always be entered at the bottom. Now I am trying to display the entries on my angularfire web app but the most current entry is displaying on the bottom of my page....how do I flip this around?
Main.js
'use strict';
angular.module('App', ["firebase"])
.controller('MainCtrl', ['$scope', '$firebase',
function ($scope, $firebase) {
var ref = new Firebase([URL])
$scope.messages = $firebase(ref.limit(10)).$asArray();
}]);
Main.html
<div class="jumobotron" ng-repeat="msg in messages">
<img class="img-responsive" ng src="[URL]/{{msg.filename}}"/>
</div>
Anyone have an idea what I should use? I tried using OrderBy and OrderByPriority but I never set priorities and push doesn't create priorities for the elements. I was hoping to just use the unique IDs which are formatted by Firebase as -JWNzwoIPWY_hSNmnzhU.
I have also tried the endAt() method but it doesn't reverse order
'use strict';
angular.module('App', ["firebase"])
.controller('MainCtrl', ['$scope', '$firebase',
function ($scope, $firebase) {
var ref = new Firebase([URL]/messages)
$scope.messages = $firebase(ref.endAt().limit(10)).$asArray();
}]);