I am trying to retrieve the data from firebase db to angular application. How to retrieve the 'course' data from firebase?
My app.component.ts is as below
import { Component } from '@angular/core';
import { AngularFireDatabase, AngularFireList} from 'angularfire2/database';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'firebase-demo';
courseList:AngularFireList<[]>;
courses$;
course$;
constructor(db:AngularFireDatabase){
this.courseList=db.list('/courses');
this.course$=this.courseList.valueChanges()
.subscribe(cousres=>{
console.log(this.course$);
})
}
}
Firebase Db structure. courses C-01: "01" C-02: "02" C-03: "03"
