Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
Angular: @Inject(MAT_DIALOG_DATA) - NgFor only supports binding to Iterables such as Arrays

I am sending data from a component page to a dialog.

I am able to receive the data, but when I try to use it in ngFor I get the error:

Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays

I've looked through 9 different SO articles on this error but I still can't seem to solve. My original code was:

Typescript:

(interface file)

export interface IPersonInternalNotes {
PersonID       : number;
Note            : string;
CreatedBy       : number;
CreatedByText   : string;
CreateDate      : string;
ModifiedBy      : number;
ModifiedByText  : string;
ModifiedDate    : string;
DeletedBy       : number;
DeletedByText   : string;
DeleteDate      : string;
}

(component file)

internalNotes: IPersonInternalNotes[] = [];
@Inject(MAT_DIALOG_DATA) public data: IPersonInternalNotes[] //in constructor)
this.internalNotes = this.data; //in  ngOnInit

HTML:

<tr *ngFor="let note of internalNotes">
      <td>{{note.CreateDate}}</td>
      <td>{{note.CreatedByText}}</td>
      <td>{{note.Note}}</td>
 </tr>  

Here is what the data looks like in the debugger:

data

I've tried many variations such as:

var myData = Object.keys(this.data).map((k) => this.data[k]);

for (let index = 0; index < myData.length; index++) {
     this.internalNotes.push(myData[index]);
}

and

this.data.forEach(element => {
     this.internalNotes.push(element);
});

and changing the html to

<tr *ngFor="let note of internalNotes.data">

but it got the error: “Property 'data' does not exist on type 'IPersonInternalNotes[]”

What am I missing? I must not be understanding something about the data type.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda