Manspof
Manspof

Reputation: 357

Get node of data from firebase

i'm trying to get data from firebase and i'm little stuck with that. enter image description here

i'm trying to get the all SemaA data i did it like that but it not give me nothing

firebase.database().ref('Courses/'+departmentId+'/SemA'),

i can specific to do (but i don't want it)

firebase.database().ref('Courses/'+departmentId+'/SemA/java'),

i also wnated to get the black sign and red sign in two different queries and run into loop to get the data from there enter image description here

Upvotes: 0

Views: 1676

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599571

If you're looking to loop over the courses in a semester:

var semesterRef = firebase.database().ref('Courses/'+departmentId+'/SemA')
semesterRef.on('child_added', function(courseSnapshot) {
    console.log(courseSnapshot.key);
});

Upvotes: 2

Related Questions