Mi código es el siguiente:
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);
}
Mi interface que recibo:
export interface Afiliados {
Nombre: string,
Email: string
}
Mi invocacion del metodo:
this.RAfiliados.getReport(this.id , 2, '' , '' , '' , '' , '20170616' , '20180719' , '' )
.subscribe(data => this.ARAfiliados = data);
A la hora de recorrer el arreglo:
<tr *ngFor="let afiliados of ARAfiliados">
<td>{{afiliados.Nombre}}</td><td>{{afiliados.Email}}</td>
</tr>
Mi respuesta json:
[
{
"nombre": " ejemplo ",
"email": "[email protected] "
},
{
"nombre": " ejemplo ",
"email": "[email protected] "
}
]
Pero a la hora de ver el resultado me mustra el tamaño total de mi respuesta pero no sepinta la informacion en la tabla.