类型“{}[]”不可分配给类型 'AngularFireList<any[]>'

Type '{}[]' is not assignable to type 'AngularFireList<any[]>'

我是 Angular 和 Firebase 的新手,我试图将节点的所有项目都添加到 AgularFireList,但出现此错误:

类型“{}[]”不可分配给类型 'AngularFireList'。 属性 'query' 在类型“{}[]”中缺失。

我的代码是:

my_notes: AngularFireList<any[]>;

constructor(public afDB: AngularFireDatabase) {
    this.getNotes()
      .subscribe(
        notas => {
          this.my_notes = notas;
        }
      );
  }

  getNotes(){
    return this.afDB.list('/notas').valueChanges();
  }

感谢您的帮助。

试试这个:

constructor(public afDB: AngularFireDatabase) {
this.getNotes()
  .subscribe(
    (notas: AngularFireList<any[]>) => {
      this.my_notes = notas;
    }
  );
}

如果问题仍然存在,请尝试添加以下代码:

getNotes(){
    return <Observable<AngularFireList<any[]>>>this.afDB.list('/notas').valueChanges();
  }