繁体   English   中英

如何在 Angular 中将 API 数据显示为列表?

[英]How do I display API data as a list in Angular?

我有一系列项目

{
    "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"
}

我想将work_description描述为work_description中的一个列表,但我得到的是一段细节。 这就是我所拥有的:

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

这就是我要的:

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

请协助

尝试这个

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM