title: i don't get fetch data from firebase real time database to angular 6
body: <p>i'm using angular 6, "@angular/fire": "^5.1.1", "firebase": "^5.6.0", i want to fetch all data of my database, but don't get it, i tried of a lot of ways, this is my appmodule.ts:</p>
  
  <pre><code>          import { BrowserModule } from '@angular/platform-browser';
        import { NgModule } from '@angular/core';
        import { AngularFireDatabaseModule } from '@angular/fire/database';
        import {AngularFireModule} from '@angular/fire';
        import {environment} from '../environments/environment';
  
        import { AppComponent } from './app.component';
  
  
        @NgModule({
          declarations: [
            AppComponent,
  
          ],
          imports: [
            BrowserModule,
            AngularFireDatabaseModule,
            AngularFireModule.initializeApp(environment.firebase),
          ],
          providers: [],
          bootstrap: [AppComponent]
        })
        export class AppModule { }
  </code></pre>
  
  <p>...and this is my appcomponent:</p>
  
  <pre><code>      import { Component, OnInit} from '@angular/core';
        import { AngularFireDatabase } from '@angular/fire/database';
        //import 'rxjs/add/operator/map';
        import {Observable} from 'rxjs';
  
        @Component({
          selector: 'app-root',
          templateUrl: './app.component.html',
          styleUrls: ['./app.component.css']
        })
        export class AppComponent implements OnInit {
  
  
          courses: Observable&lt;any[]&gt;;
  
            constructor(private db: AngularFireDatabase){
                this.courses=db.list('/courses').snapshotChanges();
            }
  
              getData(){
                return this.courses;
              }
  
            ngOnInit(){
                console.log(this.getData());
                debugger;
            }
        }
  </code></pre>
  
  <p>....i also tried with:</p>
  
  <pre><code>this.courses=db.list('/courses').valueChanges();
  </code></pre>
  
  <p>...and</p>
  
  <pre><code>this.courses=db.list('/courses').subscribe(courses=&gt;{
                  this.courses=courses;
                });
  </code></pre>