angular: show nested array with ngFor

Discussão em 'Angular' iniciado por carl, Dezembro 12, 2024.

  1. carl

    carl Guest

    enter image description here

    I have an array. It contains entries like this: array[0].name and array[0].value . Thats the easy part.

    I can show the first items with:

    <div *ngFor="let item of fields;let i = index">
    i: {{ i }} {{ item.value }}
    </div>


    That works fine.

    But i also have an array that contains an array that also might contain an array.

    How should this be proper implemented in an Angular template?

    This didnt work

    <div *ngFor="let itemJ of item.value;let j = index">
    j: {{ j }} {{ itemJ.value }}
    </div>

    Continue reading...

Compartilhe esta Página