Error : Cannot find a differ supporting object '[object Object]' of type 'object'

Error : Cannot find a differ supporting object '[object Object]' of type 'object'

错误:找不到 'object' 类型的不同支持对象“[object Object]”。 NgFor 只支持绑定到 Iterables 比如 Arrays

数据

profile(id: string) { 
  this.UserProefileServices.Userdetails(id).subscribe((data: Response) => { 
  this.userdata = data["data"]; }); 
}

我想 'this.userdata' 您在 html *ngFor 循环中使用。 *ngFor 只支持数组,所以如果 this.usetdata 是对象,你应该把它转换成数组,例如: this.userdata = Object.keys(data["data"]).reduce((arr, key) => {arr.push(data["data"][key]); return arr},[])