고객센터 필수입력

This commit is contained in:
이담 정 2022-09-30 04:18:31 +00:00
parent 4677ede99f
commit 08d6728f1a
3 changed files with 19 additions and 8 deletions

View File

@ -32,9 +32,6 @@
<mat-label>닉네임</mat-label>
<input matInput [formControlName]="'accountHolder'" />
</mat-form-field>
<mat-error *ngIf="composeForm.get('accountHolder')?.hasError('required')">
닉네임은 필수 입력입니다.
</mat-error>
<!-- Holding comp -->
<mat-form-field>

View File

@ -13,11 +13,18 @@
</div>
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
[formGroup]="customerRegistrationComposeForm"
>
<mat-form-field>
<mat-label>제목</mat-label>
<input matInput [formControlName]="'title'" />
<mat-error
*ngIf="
customerRegistrationComposeForm?.get('title')?.hasError('required')
"
>
제목은 필수 입력입니다.
</mat-error>
</mat-form-field>
<mat-form-field>
<textarea
@ -28,6 +35,13 @@
[formControlName]="'content'"
></textarea>
<mat-label>내용</mat-label>
<mat-error
*ngIf="
customerRegistrationComposeForm?.get('content')?.hasError('required')
"
>
내용은 필수 입력입니다.
</mat-error>
</mat-form-field>
<div class="flex flex-col sm:flex-row sm:items-center mt-4 sm:mt-6">
<div class="flex mt-4 sm:mt-0">

View File

@ -25,7 +25,7 @@ import { MatDialogRef } from '@angular/material/dialog';
],
})
export class CustomerRegistrationComposeComponent implements OnInit {
composeForm!: FormGroup;
customerRegistrationComposeForm!: FormGroup;
dataSource = ELEMENT_DATA;
columnsToDisplay = ['idx', 'content', 'applicationDate'];
@ -48,9 +48,9 @@ export class CustomerRegistrationComposeComponent implements OnInit {
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
accountHolder: ['', [Validators.required]],
amount: ['', [Validators.required]],
this.customerRegistrationComposeForm = this._formBuilder.group({
title: ['', [Validators.required]],
content: ['', [Validators.required]],
});
}