|
|
@ -1,6 +1,7 @@ |
|
|
|
@page "/weather" |
|
|
|
@page "/weather" |
|
|
|
@using MyBlazorApp.Services |
|
|
|
@using MyBlazorApp.Services |
|
|
|
@inject WeatherForecastService ForecastService |
|
|
|
@inject WeatherForecastService ForecastService |
|
|
|
|
|
|
|
@rendermode InteractiveServer |
|
|
|
|
|
|
|
|
|
|
|
<h3>Weather Forecast ☀️</h3> |
|
|
|
<h3>Weather Forecast ☀️</h3> |
|
|
|
|
|
|
|
|
|
|
@ -45,9 +46,9 @@ else |
|
|
|
private IEnumerable<WeatherForecast> forecasts; |
|
|
|
private IEnumerable<WeatherForecast> forecasts; |
|
|
|
private bool isLoading = true; |
|
|
|
private bool isLoading = true; |
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync() |
|
|
|
protected override void OnInitialized() |
|
|
|
{ |
|
|
|
{ |
|
|
|
await LoadForecasts(); |
|
|
|
LoadForecasts(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private async Task LoadForecasts() |
|
|
|
private async Task LoadForecasts() |
|
|
|