Add button to add a new task to the to-do list.
This commit is contained in:
parent
1fbdcdcd7c
commit
dde2d3c20d
@ -2,7 +2,10 @@
|
||||
|
||||
<h3>To-do list</h3>
|
||||
<p>List of tasks that must be done for server management.</p>
|
||||
|
||||
<hr/>
|
||||
<br/>
|
||||
<button type="button" class="btn btn-primary" @onclick="AddTask">Add Task</button>
|
||||
<br/>
|
||||
@if (items != null && items.Count > 0)
|
||||
{
|
||||
<ul>
|
||||
@ -18,4 +21,9 @@
|
||||
|
||||
@code {
|
||||
private List<ToDoItem> items = ToDoItemsRepository.GetItems();
|
||||
private void AddTask()
|
||||
{
|
||||
ToDoItemsRepository.AddItem(new ToDoItem { Name = "New Task"} );
|
||||
items = ToDoItemsRepository.GetItems();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user