簡體   English   中英

使用 Angular 顯示 JSON 對象時遇到問題

[英]Having trouble displaying JSON objects using Angular

將這個weather_code object 拉到頁面上很有趣。 有任何想法嗎? :-)

在此處輸入圖像描述

這是我的代碼:

    <div *ngFor="let forecast of this.weatherData?.forecasts | keyvalue">
    {{ forecast.value.hourly[0].weather_code }}
    </div>

預測數組在哪里? 如果整個 object 是顯示的 object (在您的屏幕截圖中),您只需執行response.forecast['2021-01-25'].hourly[0].weather_code

{{ forecast.value.hourly[0].weather_code }}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM