如何解决错误'Type'any []'类型缺少'Observable <any>'类型的以下属性

时间:2019-06-17 13:58:06

标签: google-cloud-firestore angular7

我正在为我的大学项目构建一个演示电子商务Web应用程序。 坚果我在代码中说了这个特定的错误

ERROR in src/app/user/product/product.component.ts(57,11): error TS2740: Type 'any[]' is missing the following properties from type 'Observable<any>': _isScalar, source, operator, lift, and 5 more.   

这是我得到错误的地方

getData() {
  this.dataLoading = true;
  this.querySubscription = this._backendService.getProducts('Products')
        .subscribe(members => {
          this.members = members;
          this.dataLoading = false;
        },

        (error) => {
          this.error = true;
          this.errorMessage = error.message;
          this.dataLoading = false;
        },
        () => { 
          this.error = false;
           this.dataLoading = false;
        });
}

VS Code指向此行

this.members = members;

我还创建了Observable

members: Observable<any>;

该如何解决?请帮忙!

0 个答案:

没有答案