@page "/todo"
@rendermode InteractiveServer
@attribute StreamRendering
if (todos == null)
{
<p>Loading...</p>
}
else
{
<ul>
@foreach (var todo in todos)
{
<li>@todo.Title</li>
}
</ul>
}
@code {
private List<TodoItem>? todos;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1000);
// love the new collection expressions btw!!
todos = [ new TodoItem(), new TodoItem(), new TodoItem() ];
}
}
@page "/todo"
@rendermode InteractiveServer
@attribute StreamRendering
if (todos == null)
{
<p>Loading...</p>
}
else
{
<ul>
@foreach (var todo in todos)
{
<li>@todo.Title</li>
}
</ul>
}
@code {
private List<TodoItem>? todos;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1000);
// love the new collection expressions btw!!
todos = [ new TodoItem(), new TodoItem(), new TodoItem() ];
}
}