首页 > 解决方案 > 无法使用 Angular 7 读取以下 JSON

问题描述

我无法阅读下面提到的从 Rest API收到的JSON 。

{
    "details": {
        "id": 21,
        "gstin": "27AACCG7831Q1Z0",
        "entityName": "GENX ENTERTAINMENT LIMITED",
        "entityPan": "AACCG7831Q",
        "entityTan": "abhishek123",
        "entityCin": "null",
        "entityWebsite": null,
        "natureOfBusiness": null,
        "constitution": "\"Public Limited Company\""
    },
    "addresses": [
        {
            "id": 22,
            "buildingName": "\"Solitaire Corporate Park\"",
            "location": null,
            "street": null,
            "buildingNo": "\"S-14\"",
            "state": "bihar",
            "district": "\"\"",
            "city": "\"\"",
            "flateNo": "\"1\"",
            "pincode": "\"400093\"",
            "isPrimary": false
        }
    ]
} 

我想将上述以 JSON 格式接收到的数据转换成一个表格。

标签: javascriptangularangular7

解决方案


请参阅下面的 Stakblitz 代码

stackblit_sampleCode

希望这可以帮助..!


推荐阅读