Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to read/write to nested Firebase Object in Angular #3032

Unanswered
iamastic asked this question in Q&A
Discussion options

I am working with Angular and Firebase's Real Time Database. I am currently following the AngularFire documentation and am retrieving data as lists. I can't seem to figure out how to get a nested list from within a list.

Here is an example of my Firebase RTDB structure:

- items
 - Item 1
 - age: 22
 - personality
 - temperament: "happy"
 - Item 2
 - age: 34
 - personality
 -temperament: "angry"

I would like to be able to access the temperament value to update or retrieve. This is in items/Item1/personality/. By following the documentation I have linked above, I am able to access up to items/Item1/ but cannot figure out a way to go beyond that. I have seen some solutions suggesting to use the forEach() function but could not find any documentation to help guide me.

I have also noted that the documentation linked above uses the async pipe method, which I believe automatically sorts out the subscription. Currently, I am subscribing to the observables myself within the app.component.ts file rather than using the async pipe method. This is working, however, only up to the first level. I am looking to learn how to be able to access the child nodes and more.

Any help would be appreciated!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /