Can not pull data from firebase (event though I was able to push data successfully)


#1

it has been three days and I’m trying to pull the data from firebase but with no luck , every time I try to pull the data I get this error (printed from the console) :

console.log: {"_isScalar":false,"source":{"_isScalar":false},"operator":{}}

I’m not sure what is the problem so I can understand where to look , the connection is good because I was able to push data, but I’m not sure why I’m getting this error.

here is my pulling data code :

this is an observable to store the songs list

  songs$: Observable<Song[]>;

then I tried to pull the data with this code :

 this.songs$ = this.songsServ.getSongs() // Get the DB list
.snapshotChanges() //snapshot changes to get both key and value
.map(change => {
  return change.map(c => ({
    key: c.payload.key, ...c.payload.val()
  }))
});

but nothing was listed on the list I made (which supposed to loop through the songs array) so I made a button which will run this function :

  print(){
console.log(JSON.stringify(this.songs$));
this.songs$.subscribe(song =>{
  console.log(song);
})
}

after pressing the button and executing the print function I get this output :

console.log: {"_isScalar":false,"source":{"_isScalar":false},"operator":{}}

Thanks