Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@page "/lista-de-tarefas"
<h1>Lista de tarefas</h1>
@foreach(var tarefa in tarefas)
<input placeholder="Alguma coisa para fazer..." @bind(novaTarefa) />
<button @onclick(AdicionarTarefa)>Adicionar tarefa</button>
@functions {
IList<TarefaModel> tarefas = new List<TarefaModel>();
string novaTarefa;
void AdicionarTarefa()
tarefas.Add(new TarefaModel { Titulo = novaTarefa });
novaTarefa = string.Empty;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment