错误TypeError:db.list(...)。subscribe不是函数

时间:2018-01-03 19:54:17

标签: list function typeerror subscribe

import { Component } from '@angular/core';
import {AngularFireDatabase} from 'angularfire2/database';
import 'rxjs/add/operator/take';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  firesto: any[];

  constructor(db: AngularFireDatabase) {
    db.list('/firesto')
    .subscribe(firesto => {
      this.firesto = firesto;
      console.log(this.firesto);
    });

  }
}

我收到错误,ERROR TypeError:db.list(...)。subscribe不是函数,我无法弄清楚错误

0 个答案:

没有答案