File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,22 +26,24 @@ import { WeatherContentComponent } from './components/weather-content.component'
2626
2727 <main class="main">
2828 <div class="container">
29+ @let currentState = state();
30+
2931 <app-search-form
30- [isLoading]="state() .isLoading"
32+ [isLoading]="currentState .isLoading"
3133 (search)="onSearch($event)"
3234 ></app-search-form>
3335
3436 <div class="weather-container" data-testid="weather-container">
35- <app-loading-state [isVisible]="state() .isLoading"></app-loading-state>
37+ <app-loading-state [isVisible]="currentState .isLoading"></app-loading-state>
3638
3739 <app-error-state
38- [isVisible]="!!state() .error && !state() .isLoading"
39- [message]="state() .error"
40+ [isVisible]="!!currentState .error && !currentState .isLoading"
41+ [message]="currentState .error"
4042 ></app-error-state>
4143
4244 <app-weather-content
43- [isVisible]="!!state() .weatherData && !state() .isLoading && !state() .error"
44- [weatherData]="state() .weatherData"
45+ [isVisible]="!!currentState .weatherData && !currentState .isLoading && !currentState .error"
46+ [weatherData]="currentState .weatherData"
4547 ></app-weather-content>
4648 </div>
4749 </div>
Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ import { ForecastComponent } from './forecast.component';
1414 data-testid="weather-content"
1515 [hidden]="!isVisible()"
1616 >
17+ @let currentWeatherData = weatherData();
18+
1719 <div class="weather-layout">
18- <app-current-weather [weatherData]="weatherData() "></app-current-weather>
19- <app-forecast [weatherData]="weatherData() "></app-forecast>
20+ <app-current-weather [weatherData]="currentWeatherData "></app-current-weather>
21+ <app-forecast [weatherData]="currentWeatherData "></app-forecast>
2022 </div>
2123 </div>
2224 `
You can’t perform that action at this time.
0 commit comments