Pulling Data From Firebase .list is not a function error


#1

Trying to pull data from firebase and display.i keep taking this error:
TypeError: _this.db.list(…).subscribe is not a function

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import {AngularFireAuth} from 'angularfire2/auth';
import {AngularFireDatabase,FirebaseListObservable} from 'angularfire2/database';


@Component({
  selector: 'page-profile',
  templateUrl: 'profile.html'
})

export class ProfilePage {
  profileData: FirebaseListObservable<any>


  constructor(private fire:AngularFireAuth,private db :AngularFireDatabase,public navCtrl: NavController) {

this.fire.authState.subscribe(auth =>{



this.db.list(`/profile/${auth.uid}`).subscribe(profile => {

  console.log(profile);


});
});



  }

}

Any ideas ?


#2

Are you using 5.0?

If so, according to the changelog you need to do this now:
afDb.list<Item>('items').valueChanges().subscribe(console.log);

Or in your case:
this.db.list<Profile>(`/profile/${auth.uid}`).valueChanges().subscribe(...)


#3

tried adding as you did but nothing changed.


#4

What version of AngularFireDatabase are you using?