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

150
Views
Populate html table or list with dynamic data from backend

I have a C# api endpoint that returns a List<Dictionary<string, object>>.

The problem here is this list is dynamic, so I cannot say what the elements could be so I could populate an html list (say with angular) with it, i.e.

<ul *ngFor="let data of dataList">
<li><span>{{data.propertyName}}<span/> -- <span>{{data.propertyValue}}<span/><li>
<ul>

Another data from the endpoint could have more data and different list properties, so instead of propertyName and propertyValue it could be employeeID, employeeName, dateOfBirth etc.

How do I populate the list with only one list markup and api endpoint?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If I understand your objective correctly, then in Angular you'll have the property:

dataList: object[]; // data model is unknown

In that case you can:

keys: string[];
...
this.keys = Object.keys(dataList[0]); // once data is retrieved you can extract its model

And in your HTML you can for example:

<ul *ngFor="let data of dataList">
    <li *ngFor="let prop of keys">
        <span>{{ prop }}: {{ data[prop] }} | <span/>
    <li>
<ul>
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!