Skip to content

Commit

Permalink
Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemke committed Sep 2, 2022
1 parent 7a82c1e commit 3f989ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form (submit)="submit()">
<form #chatForm="ngForm" (submit)="submit(chatForm.valid)">
<div class="input-group">
<zemke-tagbox #tagbox ci>
<input #valueEl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export class ChatInputComponent {
!this.suggestions.map(u => u.id).includes(user.id) && user.id !== this.authUser.id)));
}

submit() {
submit(valid: boolean) {
if (!valid) return;
this.disabled = true;
const message: MessageCreationDto = {
body: this.value,
Expand Down

0 comments on commit 3f989ab

Please sign in to comment.