i have done trial and error for hours.
the version that works for me is :
- angular : 4
- firebase : 4.13.1
- angularfire2 : 5.0.0-rc.3
even then i got an error in section ‘Building Real-time Apps with Firebase : chapter 6’.
in the video it is explained that AngularFireDatabase returns observable type, but for me it actually returns AngularFireList type.
So i adjust the code a bit in app.component.ts :
constructor(db: AngularFireDatabase) {
db.list(’/courses’).valueChanges()
.subscribe(courses => {
this.courses = courses;
console.log(this.courses);
})
}
and in app.component.html :
< ul>
< li *ngFor=“let course of courses”>
{{ course }}
< /li>
< ul>
to get the same result as Mosh.