Why can not I print the result of a query in angle 6?

3

My code is as follows:

getReport(id_reporte: string, destino: number, departamento: string,
      afiliacion: string, tipo_servicio: string, canal: string,
      fechai: string, fechaf: string, por: string): Observable <Afiliados[]> {

  return this.http.post<Afiliados[]>(
    this.url, JSON.stringify(
    {
      'id_reporte': id_reporte,
      'destino': destino
    }),
    httpOptions);
}

My interface that I receive:

export interface Afiliados {
    Nombre: string, 
    Email: string
}

My invocation of the method:

this.RAfiliados.getReport(this.id , 2, '' , '' , '' , '' , '20170616' , '20180719' , '' )
    .subscribe(data => this.ARAfiliados = data);

At the time of touring the arrangement:

<tr *ngFor="let afiliados of ARAfiliados">
    <td>{{afiliados.Nombre}}</td><td>{{afiliados.Email}}</td>
</tr>

My answer json:

        [
            {
                "nombre": " ejemplo ",
                "email": "[email protected] "
            },
            {
                "nombre": " ejemplo ",
                "email": "[email protected] "
            }
        ]

But at the time of seeing the result, it shows me the total size of my answer but I do not separate the information in the table.

    
asked by r0b0f0sn0w 06.08.2018 в 17:16
source

1 answer

2

You are looking for the Name attribute when you receive a name (all in lowercase), correcting that should work correctly. You can correct in the server (sending Name and Email) or in the frontend (using name and email in lower case)

    
answered by 06.08.2018 / 17:34
source