Files
Gainsight/TodoList/Pages/Accounts.razor
2022-06-13 08:50:32 -04:00

32 lines
737 B
Plaintext

@page "/accounts"
<PageTitle>Accounts</PageTitle>
<h1>Accounts</h1>
<ul>
@foreach (var account in accounts)
{
<li>
<input type="checkbox" @bind="account.LastContacted" />
<input @bind="account.AccountName" />
</li>
}
</ul>
<input placeholder="Accounts Added" @bind="newAccount" />
<button @onclick="AddAccount">Add Account</button>
@code {
private List<AccountItem> accounts = new();
private string? newAccount;
private void AddAccount()
{
if (!string.IsNullOrWhiteSpace(newAccount))
{
accounts.Add(new AccountItem{ AccountName = newAccount });
newAccount = string.Empty;
}
}
}