I am currently facing an interpolation issue that involves working with data from an API in the following format:
{columna1=6.022, columna2=0.0, columna3=3.14.....,columnaN=5.55 }
There are instances where there is only one 'columna', while in some cases there could be up to 30 'columna'. To easily interpolate them, I have implemented the following code in an HTML file:
<ng-container *ngFor="let numero of arregCols">
<p>columna{{numero}} = {{ columna[numero] }}</p>
</ng-container>
In my component.ts file:
for (let xk = 1; xk < maxCols; xk++) {
this.arregCols[this.arregCols.length] = xk.toString();
}
I am not sure if my approach to interpolation is correct.
The expected output should be:
columna1 = 6.022
columna2 = 0.0
columna3 = 3.14
...
columnaN = 5.55
However, instead of the desired result, I encounter the error message:
ERROR TypeError: Cannot read properties of undefined