Package Exports
- mat-file-upload
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mat-file-upload) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Angular Material File Upload 
This tool is a simple & configurable file upload component for use with Angular Material.
Live Demo: https://bjsawyer.github.io/mat-file-upload/

Prerequisites
In order to use mat-file-upload
in your app, you must have the following dependencies installed:
Usage
- Install package from npm (
npm i mat-file-upload
). - Add
MatFileUploadModule
to your module's imports, like so:
@NgModule({
declarations: [AppComponent],
imports: [
...
MatFileUploadModule,
...
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
- Add the element to your template, like so:
Basic:
<mat-file-upload></mat-file-upload>
Advanced:
<mat-file-upload
[labelText]="'Select a file (or multiple) to upload:'"
[allowMultipleFiles]="true"
[showUploadButton]="true"
(uploadClicked)="onUploadClicked($event)"
(selectedFilesChanged)="onSelectedFilesChanged($event)">
</mat-file-upload>
Options
@Input()
Properties
Directive | Type | Description | Default Value |
---|---|---|---|
[allowMultipleFiles] |
boolean |
True/false representing whether the user can select multiple files at a time | false |
[labelText] |
string |
The text to be displayed for the file upload label | "Select file(s)" |
[showUploadButton] |
boolean |
True/false representing whether the "Upload" button is shown in the DOM | true |
@Output()
Properties
Directive | Type | Description |
---|---|---|
(uploadClicked) |
EventEmitter<FileList> |
Event handler that emits the list of selected files whenever the "Upload" button is clicked |
(selectedFilesChanged) |
EventEmitter<FileList> |
Event handler that emits the list of selected files whenever the user changes file selection |