Receive Data from Firebase Event

Hey guys,

currently i’m working on a Ionic 2 app which receives data from a firebase database.

In my home.ts i recieve the data by

public events: any[] = [];
  private userId: any;
  
  constructor(public navCtrl: NavController,private app: App, public angfire: AngularFire, private auth: AuthProvider,  private _event: Eventdata) {

    this.userId = firebase.auth().currentUser.uid;
   //get list of posts on page init
    this.listEvents();
  }

  listEvents(){
	var that = this;


	this._event.listEventsService().then(snapshot => {
                        
                        that.events.length = 0;  
                        
                        snapshot.forEach(function (childSnapshot) {
                            var data = childSnapshot.val();
                            data['key'] = childSnapshot.key;
                            that.events.push(data);    
                            
                        });
                });
  }

this data is provided by my Eventdata Provider

constructor() {

      this._db = firebase.database().ref('/'); // Get a firebase reference to the root
      this.userNode = firebase.database().ref('users');
      this.eventsNode = firebase.database().ref('Events');
      this.eventsUserNode = firebase.database().ref('user-events');

    listEventsService(){
			return this.eventsNode.once('value'); 
    }

atm everythink works fine.

For the next step i tried to add a child_added and values listener to update my listview.
With

this.eventsNode.on("value", function(snapshot){
          console.log("child added");
});

the “child_added” is called but i dont know how to receive the new data in my home.ts page and update the existing listview.

Would be nice if someone could explain me how it works

AngularFire2 is a lot simpler to use for these things. I only use the Firebase SDK for Storage, and for a few things that AngularFire doesn’t wrap yet (which you don’t have to worry about for a while).

So, how could i solve my problem with AngularFire2?

https://github.com/angular/angularfire2/blob/master/docs/3-retrieving-data-as-lists.md