I'm using v0.7.1 and already convert objects to array with this
<div ng-repeat="data in datas | orderByPriority">{{data.$id}}</div>
but nothing show. any idea?
update include fiddler http://plnkr.co/edit/KrktzaU7AzJIGKfW8w2k
I'm using v0.7.1 and already convert objects to array with this
<div ng-repeat="data in datas | orderByPriority">{{data.$id}}</div>
but nothing show. any idea?
update include fiddler http://plnkr.co/edit/KrktzaU7AzJIGKfW8w2k
Your fiddle doesn't receive data from Firebase - it means that the object you are filtering is not angularFire instance, so it cannot potentially know its $id ($getIndex).
var app = angular.module('plunker', ['firebase']);
app.controller('MainCtrl', function($scope, $firebase, $timeout) {
$scope.datas = $firebase(new Firebase("https://jsfiddle001.firebaseio.com/"));
});
I modified your fiddle and it works fine: http://plnkr.co/edit/zM1CFmEJJ4s3BIqBzmqG?p=preview
orberByPriority doesn't provide any extra options, e.g. to reverse order. Chain Angular filters to get more flexibility:
<div ng-repeat="data in datas | orderByPriority | orderBy : '$id' : true">
$idnot showing. please check fiddle. tanks - vzhen