Subscription is not assignable


#1

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


#2

I don’t understand why you’re assigning anything to this.bills, let alone a subscription. Isn’t the push inside the subscription doing all the work?


#3

As usual you are right :)… Thanks. Plain stupid :rage: of me