Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

I want to understand small issue about subscribe firebase list

$
0
0

@_Ali94 wrote:

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()”

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>