Currently, I am utilizing angularFire to establish a connection between my webpage and my database. My goal is to showcase all the users stored in my firebase database as a list on a specific page. The user data structure in my Firebase database appears like this:
users
|_date1
| |_hour1
| |_email:name
|_date2
| |_hour2
| |_email:name
|...
However, when attempting to retrieve this data with the following method, I encounter an issue where I can only access one "subsection" instead of the other child elements:
this.fireDB.list('users').snapshotChanges().subscribe(res => {
res.forEach(doc => {
this.credentialsArray.push(doc.key, doc.payload.val());
});
});
To populate my credentialsArray
with the appropriate data using the Credential
model, I need to execute the following code snippet:
this.credentialsArray.push(new Credential('name', 'email'));
Additionally, I aim to capture the time and date information linked to each entry. How can I achieve this?