Как решить ОШИБКУ `Type 'any []' отсутствуют следующие свойства из типа 'Observable <any>'` - PullRequest
0 голосов
/ 17 июня 2019

Я создаю демонстрационное веб-приложение для электронной коммерции для своего проекта в колледже. Я получаю эту конкретную ошибку в своем коде, говоря:

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 Код указывает на эту строку

this.members = members;

Я также создал Наблюдаемую

members: Observable<any>;

Как мне это исправить? Пожалуйста, помогите!

...