I should start out by saying I am new to Ionic and I am trying to learn Ionic through the various tutorials online. I have run into an issue and cannot get past it. I am setting up a simple chat application and can push messages to firebase through…
this.db.object('/chat/').subscribe( data => {
console.log(data);
})
I get the following error…
Runtime Error
Uncaught (in promise): TypeError: this.db.object(…).subscribe is not a function TypeError: this.db.object(…).subscribe is not a function at new ChatPage
I have the following in the import section of the .ts file…
import { AngularFireDatabase, FirebaseListObservable } from ‘angularfire2/database’;
I’ve been trying a bunch of different methods, but nothing seems to work. Any help would be appreciated.
What version of AngularFire2 are you using? In version 5RC they changed the database API, FirebaseListObservable and FirebaseObjectObservable were removed in favor of AngularFireList and AngularFireObject.
Go through their docs, there were a few breaking changes (all of them in the Database API).
Runtime Error
Uncaught (in promise): TypeError: this.db.list(…).subscribe is not a function TypeError: this.db.list(…).subscribe is not a function at new ChatPage