1
votes

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

1
You didn't provide enough info in order for us to help you... Does it print anything at all without the filter? - Alexander Burakevych
@AlexanderBurakevych updated the question. yes, the data is print fine with and without filter. just $id not showing. please check fiddle. tanks - vzhen
@vzhen your fiddle doesn't take data from Firebase - it means that the object you are filtering is not angularFire instance, it doesn't have $getIndex property that's why $id is not added: github.com/firebase/angularFire/blob/master/angularfire.js - Alexander Burakevych

1 Answers

1
votes

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">