From 973c89f8b7ea4b18212a1de1266d9c9bb08fc55d Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Thu, 29 May 2025 18:44:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Error=20display=20in=20drag&drop?= =?UTF-8?q?=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/drag-drop/drag-drop.component.html | 5 +++++ src/app/components/drag-drop/drag-drop.component.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/components/drag-drop/drag-drop.component.html b/src/app/components/drag-drop/drag-drop.component.html index 8c1d342..7193af6 100644 --- a/src/app/components/drag-drop/drag-drop.component.html +++ b/src/app/components/drag-drop/drag-drop.component.html @@ -39,6 +39,11 @@ /> + +
+ {{ errorMessage }} +
+
(); @Output() fileRemoved = new EventEmitter(); @@ -61,9 +62,8 @@ export class DragDropComponent implements OnChanges { } private updateFileNames(files: FileList): void { - for (let i = 0; i < files.length; i++) { - this.fileNames.push(files[i].name); - } + const newFileNames = Array.from(files).map(file => file.name); + this.fileNames = [...this.fileNames, ...newFileNames]; } removeFile(fileName: string, event: Event): void {