Answers for "input type file events angular"

1

angular 2 input file change value

<input #FileDialog accept=".xlsx" type="file" class="d-none" (change)="selected_file($event)">
Posted by: Guest on July-30-2020
0

input type file in html events angular

// HTML
<input type="file" (change)="uploadFile($event)">

// TS
uploadFile(event: Event) {
    const element = event.currentTarget as HTMLInputElement;
    let fileList: FileList | null = element.files;
    if (fileList) {
      console.log("FileUpload -> files", fileList);
    }
}
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language