I want to understand small issue about subscribe firebase list

Hi guys,

In this topic I want small answer to understand the idea of subscribing firebase list.

my issue is:

I have more than one firebase list and I used this bellow code to subscribe them:

what I want to understand it “How the function ‘getData()’ run when I add new answer without put it in the part of answers subscribe ?”

public $questions: FirebaseListObservable<any[]>;
public questions=[];
public $answers: FirebaseListObservable<any[]>;
public answers=[];
...
this.$questions = this.afd.list('/questions/');
this.$answers= this.afd.list('/answers/');
...
this.$questions.subscribe(list=>{
this.questions=list;
    this.getData();
});
this.$answers.subscribe(list=>{
    this.answers=list;
});

NOTE: I used “answers” list in the function “getData()”