在angular 7中列出json数据时出现错误" error : Error to diff 'object Object'.Only array and iterables in allowed“import { Component, OnInit, Input} from '@angular{ Injectable } from '@angular/core';
import
ERROR in src/app/services/product.service.ts(15,9): error TS2322: Type 'Observable<Product>' is not assignableto type 'Observable<Product[]>'.switchMap, catchError } from 'rxjs/operators';
import { of } from 'rxjs