Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

513
Views
How to use *ngFor parent index as a parameter in a nested *ngfor

Im trying to pass my parent index to a nested ngFor so i can access an array: "name1, name2, etc"

<ion-item *ngFor="let b of banca ; let i = index">
   <ion-select>
       <ion-select-option *ngFor="let n of name + [i+1]" [value]="n">{{n}}</ion-select-option>
   </ion-select>
</ion-item>

Error:

Cannot find a differ supporting object 'undefined1' of type 'string'. NgFor only supports binding to Iterables such as Arrays.

I´ve tried different combinations but i can't figure it out. How is the correct syntax to pass the value?

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Although the question is not entirely clear what you are trying to do could never work.In your example name0 is the list,then name1 and name2, etc. The error says "Undefined1" is not an array because not even name exists. If what you want to do is iterate an array inside the initial array you can do

  <ion-item *ngFor="let b of banca ; let i = index">
   <ion-select>
      <ion-select-option *ngFor="let n of b.name[i]" [value]="n.attribute"></ion-select-option>
   </ion-select>
</ion-item>

where attribute is anything you got in that array

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!