0

I'm not sure if there is any example for my question or not but I want to re-sort or edit my firebase list by using any possible methods.

for example: I have this firebase list:

public classesList: FirebaseListObservable<any[]>;
...
this.classesList = this.afd.list('/classes/',{
  query:{
    orderByChild:'uemail',
    equalTo: 'user1@gmail.com'
  }
})

And this is a sample example of contains of classesList

classesList
-- class1
----- day: 'sun,tus,thu' 
----- time: '10:00'
-- class2
----- day: 'sun,thu'
----- time: '8:00'
-- class3
----- day: 'sun,thu'
----- time: '9:00'

My problem: how can make "if statements" between the classes to re-sort my list or push the values in other temp array to use it in my html (& should I add 'async' for the temp array or not ?) !

Ali H
  • 903
  • 14
  • 36

1 Answers1

0

Where is the uemail child in your classesList example? The output of this.afd.list is an object. of children matching the query. You can use a function that converts an object to an array, and then sort the array the way you want.

Ari
  • 7,251
  • 11
  • 40
  • 70