From e87e754f92ed18b0874482079a69eb39c53a56fb Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Mon, 24 Jun 2024 10:50:30 +0200 Subject: [PATCH] Display some custom error messages --- src/app/recipe-add/recipe-add.component.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/recipe-add/recipe-add.component.html b/src/app/recipe-add/recipe-add.component.html index 5f6ad9f..1509a3f 100644 --- a/src/app/recipe-add/recipe-add.component.html +++ b/src/app/recipe-add/recipe-add.component.html @@ -2,10 +2,19 @@ + @if (createForm.controls.name.errors?.['minlength']) { + Le nom doit contenir au moins {{ createForm.controls.name.errors!['minlength'].requiredLength }} caractères. + } + @if (createForm.controls.name.errors?.['maxlength']) { + Le nom ne peut dépasser {{ createForm.controls.name.errors!['maxlength'].requiredLength }} caractères. + } + @if (createForm.controls.description.errors?.['maxlength']) { + La description ne peut dépasser {{ createForm.controls.description.errors!['maxlength'].requiredLength }} caractères. + }