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

125
Vistas
ngFor gives an error even tho I have already imported BrowserModule, and CommonModule

Error: Property binding ngForOf not used by any directive on an embedded template Error especifically occurs because of the * in ngFor. If I take out the '*' and just put 'ngFor', I get an error 'Identifier 'recipe' is not defined.' 'recipes' is a class member variable in my TS file.

This is my html code:

<a href="#" class="list-group-item clearfix" *ngFor="let recipe of recipes">
            <div class="pull-left">
                <h4 class="list-group-item-heading">{{ recipe.name }}</h4>
                <p class="list-group-item-text">{{ recipe.description }}</p>
            </div>
</a>

This is what I have in my TS file:

export class RecipeListComponent implements OnInit {
  recipes: Recipe[] = [
    new Recipe(
      'A Test Recipe',
      'this is simply a test',
      'https://delightfuladventures.com/wp-content/uploads/2019/10/vegan-stuffed-sweet-potatoes-recipe.jpg'
    ),
    new Recipe(
      'A Test Recipe 2',
      'this is simply a test',
      'https://delightfuladventures.com/wp-content/uploads/2019/10/vegan-stuffed-sweet-potatoes-recipe.jpg'
    ),
  ];

  constructor() {}

  ngOnInit(): void {}
}
about 4 years ago · Juan Pablo Isaza
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