Browse Source

fix for demo

Oscar José Nuñez Chávez 6 years ago
parent
commit
90fbf7dce9

+ 1 - 1
src/app/components/plugins/weather-card/weather-card.component.html

@@ -13,7 +13,7 @@
     </div>
     <div class="col-lg-5 col-md-6 col-xs-12">
       <div class="temp">
-         <img src="assets/img/{{icon}}.png" alt="" width="60">
+         <img src="assets/img/{{icon}}.png" alt="" width="60" *ngIf="icon_exists">
          <span>{{temp}}°</span>
       </div>
     </div>

+ 2 - 0
src/app/components/plugins/weather-card/weather-card.component.ts

@@ -25,6 +25,7 @@ export class WeatherCardComponent implements OnInit {
   cityName: string;
   cityAdded = false;
   icon: string;
+  icon_exists: boolean;
   pipe = new DatePipe('es-ES')
   newDate = Date.now();
   currentDate = this.pipe.transform(this.newDate, 'fullDate')
@@ -40,6 +41,7 @@ export class WeatherCardComponent implements OnInit {
         this.cityName = payload.name
         this.state = payload.weather[0].description;
         this.temp = Math.ceil(payload.main.temp);
+        this.icon_exists = true;
         this.icon = payload.weather[0].icon;
       }, (err) => {
         this.errorMessage = err.error.message;