29 lines
440 B
Plaintext
29 lines
440 B
Plaintext
@page "/"
|
|
@using PokemonSleepInterface.Models
|
|
@using PokemonSleepInterface.Service
|
|
|
|
<PageTitle>Home</PageTitle>
|
|
|
|
|
|
@inject PokemonService PokemonService
|
|
|
|
<h3>Data from API</h3>
|
|
|
|
@if (data == null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<h1>@data.Message</h1>
|
|
|
|
}
|
|
|
|
@code {
|
|
private ResponseDto data;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
data = await PokemonService.GetAllPokemonAsync();
|
|
}
|
|
} |