Home > Software design >  How do I display API data as a list in Angular?
How do I display API data as a list in Angular?

Time:12-07

I have an array of items

{
    "id": 1,
    "work_description": [
        "Did this and that",
        "Doing this and that",
        "Does that and that",
        "Do this and that"
    ],
    "company_name": "Google",
    "time_range": "April 2021 - Current",
    "position": "Sales"
}

I want to describe work_description as a list in Angular, but what I get is a paragraph of the details. This is what I have:

Did this and that, Doing this and that, Does that and that, Do this and that

This is what I want:

Did this and that
• Doing this and that
• Does that and that
• Do this and that

Kindly assist

CodePudding user response:

try this

<li *ngFor="let item of obj.work_description">{{item}}</li>
  • Related