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不是函数,我无法弄清楚错误