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

559
Views
Angular *ngFor - Cant get my Arrays to loop

This keeps kicking upError: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays. But it works when I try print it to the console, any help be appreciated big time guys

Thank you (:

//TypeScript File :
public names = ["Jimmy" , "Lilly"];
  public ages = [20,25];
  public profile = {
    Name : this.names,
    Age : this.ages
  }

//HTML File :
<div *ngFor = "let i of profile">
    {{i.Name}}
    {{i.Age}}
</div>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The error already mentions what's the issue.

NgFor only supports binding to Iterables such as Arrays

You need to use an array in order that *ngFor works

//TypeScript File
public jimmy = { Name: "Jimmy", Age: 20 };
public lilly = { Name: "Lilly", Age: 25 };
public profiles = [jimmy, lilly]
//HTML File :
<div *ngFor = "let i of profiles">
    {{i.Name}}
    {{i.Age}}
</div>
about 4 years ago · Juan Pablo Isaza Report

0

I don't know if I'm sure about what you're trying to accomplish, but binding i.Name is incorrect since you defined Name as an array. You could loop over profile.Name using ngFor and then bind the property "name". Changing variable names could be less confusing:)

<div *ngFor="let i of profile.Name">
{{i.name}}
</div>

Same is applicable for Age

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!