Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个有趣的时间把这个weather_code对象拉到页面上。有任何想法吗?:-)
weather_code
这是我的代码:
<div *ngFor="let forecast of this.weatherData?.forecasts | keyvalue"> {{ forecast.value.hourly[0].weather_code }} </div>
预测数组在哪里?如果整个对象是显示的对象(在您的屏幕截图中),您只需要做response.forecast['2021-01-25'].hourly[0].weather_code
response.forecast['2021-01-25'].hourly[0].weather_code
{{ forecast.value.hourly[0].weather_code }}