I am trying to get the id from the list items from firebase. Not sure what’s wrong with this:
this.bills = angFire.list('Bills', { preserveSnapshot: true}).subscribe(snapshots=>{
snapshots.forEach(snapshot => {
console.log(snapshot.key, snapshot.val());
this.bills.push({
id: snapshot.key,
name: snapshot.val().name
});
});
});
I am getting error-- Type ‘Subscription’ is not assignable to type ‘FirebaseListObservable<any[]>’. Property ‘$ref’ is missing in type ‘Subscription’.
Kindly help