title: angular2 listening for changes with Firebase
body: <p>I'm new to Firebase and I would like to listen for changes in the database.</p>
  
  <p>This is what I have tried</p>
  
  <pre><code>constructor(
    private af:AngularFire,
   ){
  
    this.af.database().ref('registered').on('value', function(snapshot) { //syntax error
      console.log("changed");
    });
  
    }
  </code></pre>
  
  <p>How do I listen for changes with Firebase and angular2?</p>
  
  <p>I have also tried setting up on the OnInit</p>
  
  <pre><code>OnInit(){
      this.af.database().ref('registered').on('value', function(snapshot) {
        console.log("changed");
       });
  
  }
  </code></pre>
  
  <p>and returns an error <code>this.af.database is not a function</code>.</p>