Multiple for loop in template complained object not as array

Hi, I have this kind of data in my console.log :

  1. 0: Array(20)
  2. 0: {terms: {…}, xterms: {…},}
  3. 1: {terms: {…}, xterms: {…}}}
  4. 0: Array(120)
  5. 0: {terms: {…}, xterms: {…},}
  6. 1: {terms: {…}, xterms: {…}}}
  7. 0: Array(200)
  8. 0: {terms: {…}, xterms: {…},}
  9. 1: {terms: {…}, xterms: {…}}}

I stored the data into :

this.datalists = data;

and in my template file I managed to print out :

<ion-row class=“border-bottom” *ngFor=“let data of datalists; let i=index” >
{{data[i].name}}

{{dat.name}}

the 2nd ngfor failed with a message : ERROR Error: Cannot find a differ supporting object ‘[object Object]’ of type ‘object’. NgFor

is there anyway I can multi loop nested data? as its not possible as now

thank you

I think it should be: datalists[i]?.name or data?.name in your case.

And you can print out json by: {{data|json}}

I solve it by using :

getKeys(data){
return Object.keys(data);
}

and parsing it in my template solve what I needed :slight_smile: