Govi-Boy
Govi-Boy

Reputation: 99

How to access an array in an array in a collection

`component :-

*ngFor="let ind of industryService.industries" value="{{ind.field[1].fieldName}}"`

How access fieldName in this collection object here

Upvotes: 0

Views: 35

Answers (1)

Emilien
Emilien

Reputation: 2761

In order to do that, you will need to go deeper throught your object :

[value]="ind.field[0].field_id.fieldName"

And if you want to ngFor of field :

<div *ngFor="let ind of industryService.industries; let i = index" [value]="ind.field[index].field_id.fieldName">
  <div *ngFor="let fieldItem of ind.field>
    <p>{{ fieldItem.fieldName }}</p>
  </div>
</div>

Upvotes: 1

Related Questions