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

480
Views
Usando la variable Typescript para crear img src

Tengo una matriz que contiene una lista de categorías, a continuación se muestra un ejemplo de una categoría: descripción: "prueba"

 [0] icon: "assets/images/test1" name: "test" [1] icon: "assets/images/test2.png" name: "test 2"

Estoy tratando de recorrer esta matriz y mostrar tanto el nombre de la categoría como el ícono, sin embargo, mostrar el ícono no funciona.

 <ng-container *ngFor="let category of this.categories> {{category.name}} <img src={{category.icon}}/> </ng-container>

¿Alguien sabe como hacer esto? Gracias

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

No soy un experto angular, pero ¿no debería usar la sintaxis [] para el enlace de propiedades ?

P.ej:

 <ng-container *ngFor="let category of this.categories"> {{category.name}} <img [src]="category.icon"/> </ng-container>

Además, te falta un " al final de las categorías.

over 4 years ago · Santiago Trujillo 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
Virtual assistant