【发布时间】:2018-09-17 17:21:34
【问题描述】:
我已经连接了 firebase 和 Flamelink,并在 Flamelink 中添加了两个模式。博客和家。我希望管理网站内容,因此只需要读取权限。
我想在我的 Angular 5.4.1 前端读取数据,但这就是事情开始变得模糊的地方。从我可以看到 AngularFireList 已经取代了 FirebaseListObservable 但我不太明白我需要如何使用它。
import { Component } from '@angular/core';
import { AngularFireDatabase,
AngularFireList,
} from 'angularfire2/database';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
items: Observable<any[]>;
constructor(public db:AngularFireDatabase){
this.items = db.list('/flamelink/environments/production/content/blog/en-US/').valueChanges();
console.log(this.items);
}
}
这是控制台中记录的内容,如果我将项目设置为键入 AngularFireList 也会出现错误
【问题讨论】: