I tried to get data from firebase using angular2 today without success, I can hide the log data and view the object, but to reuse it I have undefined in the console, maybe the problem with synchronous and asynchronous data is that I want to get this data using angular2?
Thank you
read(){
this.publicationUrl = "https://FBURL/publication";
this.PublicationRef = new Firebase(this.publicationUrl);
this.PublicationRef.on("child_added", function(snapshot){
this.publication = snapshot.val();
console.log(this.publication)
})
}
Run code
source
share