Display some custom error messages
This commit is contained in:
@@ -2,10 +2,19 @@
|
||||
<mat-form-field>
|
||||
<label for="name">Nom</label>
|
||||
<input matInput id="name" type="text" formControlName="name" required>
|
||||
@if (createForm.controls.name.errors?.['minlength']) {
|
||||
<mat-error>Le nom doit contenir au moins {{ createForm.controls.name.errors!['minlength'].requiredLength }} caractères.</mat-error>
|
||||
}
|
||||
@if (createForm.controls.name.errors?.['maxlength']) {
|
||||
<mat-error>Le nom ne peut dépasser {{ createForm.controls.name.errors!['maxlength'].requiredLength }} caractères.</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<label for="description">Description</label>
|
||||
<textarea matInput id="description" type="text" formControlName="description" required></textarea>
|
||||
@if (createForm.controls.description.errors?.['maxlength']) {
|
||||
<mat-error>La description ne peut dépasser {{ createForm.controls.description.errors!['maxlength'].requiredLength }} caractères.</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<div>
|
||||
<label for="image">Image</label>
|
||||
|
Reference in New Issue
Block a user