Display some custom error messages

pull/5/head
Clément FRÉVILLE 1 week ago
parent f6b83f8a8b
commit e87e754f92

@ -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>

Loading…
Cancel
Save