When I use:
af.database.list('/items', {
query: {
orderBy: 'score',
limitToLast: 15
}
});
it does not return ordered items list.
Any issues with angularfire2 ordering?
The correct syntax would be
af.database.list('/items', {
query: {
orderByChild: 'score',
limitToLast: 15
}
});
orderBy is part of an older version of Firebase and is only supported by the main firebase library, or well, it used to be until 2.4.2. Idk if they still support it in 3.0+. AngularFire uses orderByChild and that's what you should use.
Thanks.
Is there any way that we can use orderBy with 'ascending' and 'descending' in this code of AngularFire?
af.database.list('/items', {
query: {
orderByChild: 'score',
limitToLast: 15
}
});
See #338
Closing due to @lf-alves great work!
Most helpful comment
The correct syntax would be
orderBy is part of an older version of Firebase and is only supported by the main firebase library, or well, it used to be until 2.4.2. Idk if they still support it in 3.0+. AngularFire uses orderByChild and that's what you should use.