FirebaseObjectObservable is deprecated but it still is used on this doc page https://github.com/angular/angularfire2/blob/master/docs/rtdb/objects.md
See original GitHub issueit’s confuse, since the documentation in the link on the issue titles it still is use FirebaseObjectObservable
instead of AngularFireList<T>
as is mentioned on this link https://github.com/angular/angularfire2/blob/master/docs/version-5-upgrade.md
here an image what I’m getting when I try to use AngularFireList<T>
to retrive an object
please let me know how can I solve this issue?
thank you so much.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
How to use the @angular/fire/database-deprecated ... - Snyk
To help you get started, we've selected a few @angular/fire/database-deprecated.FirebaseObjectObservable examples, based on popular ways it is used in ...
Read more >error : AngularFireDatabase, @angular/fire/database ...
But I don't know how to use that to retrieve the app related data. That's why I'm using deprecated one FirebaseObjectObservable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Let’s try to make some points here:
AngularFireObject<any> author = db.object('authors')
.Observable<any> author = db.object('authors').valueChanges()
AngularFireObject<any> author = db.object('authors/${authorId}')
orAngularFireList<any> authorsList = db.list('authors')
AngularFireObject<Author>
instead of<any>
import { Component, OnDestroy } from '@angular/core';
I hope this answer is readable and helpful for you:)
Hi @kaygeeklaas,
Maybe in the “get started” section is not fully updated, but here you have the documentation in detail, all fine 😃
real time db docs updated
Anyway here is the solution to your problem: db.object will return an AngularFireObject indeed, but what you need to display on the view is an Observable<Author> (or Observable<any> in case you don’t want to define the object); to get an observable out of an AngularFireObject you need to call .valueChanges(), then your binding to the view for the authors list will work with the async pipe correctly.
component.ts
component.html
I would encourage you to read a bit more of information about Observables in order to fully understand them