From bc4d8f713b4c18f3f42a20e84ea0e1b60aeded48 Mon Sep 17 00:00:00 2001 From: OzBob Date: Mon, 12 Jul 2021 15:53:16 +0800 Subject: [PATCH] Update mat-file-upload.component.ts emit error on error e.g. file size exceeds server limit and throws 413 response. --- .../src/lib/mat-file-upload/mat-file-upload.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/angular-material-fileupload/src/lib/mat-file-upload/mat-file-upload.component.ts b/projects/angular-material-fileupload/src/lib/mat-file-upload/mat-file-upload.component.ts index 5f4d6d1..ab4f58d 100644 --- a/projects/angular-material-fileupload/src/lib/mat-file-upload/mat-file-upload.component.ts +++ b/projects/angular-material-fileupload/src/lib/mat-file-upload/mat-file-upload.component.ts @@ -137,7 +137,7 @@ export class MatFileUploadComponent implements OnInit, OnDestroy { this.fileUploadSubscription.unsubscribe(); } this.uploadInProgressSubject.next(false); - this.onUpload.emit({ file: this._file, event: event }); + this.onUpload.emit({ file: this._file, event: error }); }, () => this.uploadInProgressSubject.next(false) )