Read Firebase Data


#1

Hi. I am new to Firebase and I am really confused with this. How will I able to join CHALLENGES table with USERS table based on PLEDGES?
I have two tables:
For challenges


For users

This is what I get
3

Below is my code of getting the challenges.

return new Observable(observer => {
      this.challengeRef.on('value', challengeSnapshot => {
        var arrChallenges = []
          challengeSnapshot.forEach((childSnapshot) => {
            
            arrChallenges.push({
              id: childSnapshot.key,
              data: childSnapshot.val()
            });
            return false;
          });
          observer.next(arrChallenges)
      });
    });

Also, I keep on getting this error with the code above when trying to bind the data:

ERROR Error: Uncaught (in promise): Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.

Thanks in advance!!! :slight_smile:


#2

The root of the problem seems to be in the interaction between your HTML template and whatever you’re binding to a list.

I’d post more code. Your HTML and component.ts to get a better idea.