22 lines
574 B
Plaintext
22 lines
574 B
Plaintext
<EditForm Model="_model" OnValidSubmit="OnValidSubmit">
|
|
<DataAnnotationsValidator />
|
|
<ValidationSummary />
|
|
|
|
<label for="content">Your comment</label>
|
|
<InputTextArea id="content" @bind-Value="_model.Content" />
|
|
|
|
<button type="submit">Post your comment</button>
|
|
</EditForm>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public EventCallback<PublishCommentCommand> OnSubmit { get; set; }
|
|
|
|
private PublishCommentCommand _model = new PublishCommentCommand();
|
|
|
|
private async Task OnValidSubmit()
|
|
{
|
|
await OnSubmit.InvokeAsync(_model);
|
|
_model = new PublishCommentCommand();
|
|
}
|
|
} |