0

After solve lot of problems to make my app work, http headers and more... now it's working!

Now, when I try to show the data into my app I have a little problem - ask.

I have this schema:

export class Morosos {
idlor:  String;  comunidad: String; vivienda: String;  demandado:   String;  importe:   String;  datos: [{ fecha: String, dato: String }];  date: { type: Date };}

And I have this on .html component:

<tr *ngFor="let p of results; let i=index">
  <td>{{p.idlor}}</td>
  <td>{{p.comunidad}}</td>
  <td>{{p.vivienda}}</td>
  <td>{{p.demandado}}</td>
  <td>{{p.importe}}</td>
  <td>{{p.datos | json}} </td>
  <td>{{p.date}}</td>
</tr>

And i got this:

IDLOR Comunidad Vivienda Demandado Importe Datos Fecha LOR01/16 XXX XXX XXX XXXX [ { "fecha": "08/03/2017", "dato": "Pagado Ejecucion" }, { "fecha": "27/07/2016", "dato": "Carta enviada" } ] 1970-01-01T00:00:00.000Z

As you can see I have a JSON on "Datos" which is an array, now my dude is how to put it into a <tr><td> too.

Thanks :)

2
  • Could you include your result as your actual JSON, now it really doesn't make sense ;) Commented Mar 30, 2017 at 12:55
  • { "_id": { "$oid": "58c81ba0fb02f3066e2af169" }, "idlor": "LOR01/16", "comunidad": "x", "vivienda": "x", "demandado": "x", "importe": "x", "datos": [ { "fecha": "08/03/2017", "dato": "Pagado Ejecucion" }, { "fecha": "27/07/2016", "dato": "Carta enviada" } ], "date": { "$date": "1970-01-01T00:00:00.000Z" } } Commented Mar 30, 2017 at 13:03

1 Answer 1

1

You can use one mre ngFor in the td with ul tag.

<td>
  <ul *ngFor="let p of p.datos">
    <li>{{p}}</li>
   </ul>
</td>

Sign up to request clarification or add additional context in comments.

1 Comment

Where you put "let p" is "let d" but it works fine. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.