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

510
Views
Cómo usar el índice principal *ngFor como parámetro en un *ngfor anidado

Estoy tratando de pasar mi índice principal a un ngFor anidado para poder acceder a una matriz: "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:

No se puede encontrar un objeto de soporte diferente 'undefined1' de tipo 'string'. NgFor solo admite el enlace a Iterables como Arrays.

He probado diferentes combinaciones pero no logro resolverlo. ¿Cómo es la sintaxis correcta para pasar el valor?

¡Gracias!

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

0

Aunque la pregunta no está del todo clara, lo que está tratando de hacer nunca podría funcionar. En su ejemplo, el nombre 0 es la lista, luego el nombre 1 y el nombre 2, etc. El error dice que "Undefined1" no es una matriz porque ni siquiera existe el nombre. Si lo que quiere hacer es iterar una matriz dentro de la matriz inicial, puede hacerlo

 <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>

donde atributo es todo lo que tienes en esa matriz

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!