Hola https://openweathermap.org/weather-conditions en ese enlace están todos los códigos del clima, y me parece que esta mal usar cod, se usa weather.id para obtener el código del clima y poder mostrar la imagen. Saludos.
-
check_circle_outlineMódulo 1 | 3 clases
Introducción
expand_more -
check_circle_outlineMódulo 2 | 4 clases
Bases del Proyecto
expand_more -
check_circle_outlineMódulo 3 | 10 clases
Clima en tiempo real
expand_more-
done_all
Clase 1
Módulo Http en Angular
-
done_all
Clase 2
Sujetos, Observadores y Observables
-
done_all
Clase 3
Obtener el clima actual de OpenWeather
-
done_all
Clase 4
Mocking de datos en desarrollo
-
done_all
Clase 5
El método pipe en RxJS
-
done_all
Clase 6
Reestructurar la información
-
done_all
Clase 7
El pipe async de Angular
-
done_all
Clase 8
Layouts con CSS Grid
-
done_all
Clase 9
Iconos animados para el clima
-
done_all
Clase 10
Mejorando la interfaz de la app
-
-
check_circle_outlineMódulo 4 | 5 clases
Pronóstico del clima
expand_more -
check_circle_outlineMódulo 5 | 3 clases
Animaciones
expand_more -
check_circle_outlineMódulo 6 | 5 clases
Geolocalización
expand_more -
check_circle_outlineMódulo 7 | 0 clases
Despedida
expand_more
4 comentario(s)
les dejo el set de if
if (this._weatherId >= 200 && this._weatherId <= 250) {
if (this._weatherId >= 200 && this._weatherId <= 250) {
this.icon = 'thunder';
}
if (this._weatherId >= 300 && this._weatherId <= 350) {
this.icon = 'rainy-4';
}
if (this._weatherId >= 500 && this._weatherId <= 550) {
this.icon = 'rainy-7';
}
if (this._weatherId == 600) {
this.icon = 'snowwy-4';
}
if (this._weatherId == 601) {
this.icon = 'snowwy-5';
}
if (this._weatherId > 601 && this._weatherId <= 650) {
this.icon = 'snowwy-6';
}
if (this._weatherId == 800) {
this.icon = 'day';
}
if (this._weatherId == 801) {
this.icon = 'cloudy-day-1';
}
if (this._weatherId == 802) {
this.icon = 'cloudy-day-2';
}
if (this._weatherId > 802) {
this.icon = 'cloudy-day-3';
}
Siguiendo el comentario que esta debajo de @gabho pienso que si es lo correcto usar weather.id, para eso es necesario acomodar varios archivos
current-weather.component.html <app-weather-icon [weatherId]="weather.id"></app-weather-icon>
weather-icon.component.ts icon: string = ''; _weatherId: number; @Input() set weatherId(value: number) { this._weatherId = value;
Uriel puedes dejar el código de openWeather para el retorno de los íconos? Gracias.
Clase 15