When the weather changes, the new icon property is added:
card.querySelector('.current .icon').classList.add(app.getIconClass(current.code));
Since old properties are not removed, the icon does not change.
I fixed this by adding
card.querySelector('.current .icon').classList.remove(...weatherIcons);
and defining the weathericons as a varible
var weatherIcons = ['partly-cloudy-day', 'cloudy', 'windy', 'fog', 'snow', 'thunderstorms', 'rain', 'clear-day']
Thanks for the feedback. I've rewritten the codelab from scratch and believe I have fixed this issue. The code has been updated, and the new guide is now live.
If you find any issues with the new codelab, please let us know!
When the weather changes, the new icon property is added:
card.querySelector('.current .icon').classList.add(app.getIconClass(current.code));
Since old properties are not removed, the icon does not change.
I fixed this by adding
card.querySelector('.current .icon').classList.remove(...weatherIcons);
and defining the weathericons as a variblevar weatherIcons = ['partly-cloudy-day', 'cloudy', 'windy', 'fog', 'snow', 'thunderstorms', 'rain', 'clear-day']