Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

520
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda