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

124
Views
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
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!