Question: how to import xlsx in angular?
Answer: import * as XLSX from 'xlsx'; 3. HTML Code: <input type="file" (change)="onFileChange($event)"> 4. Angular Typescript: exceltoJson = {}; onFileChange(event: any) { this. exceltoJson = {}; let headerJson = {}; /* wire up file reader */ const target: DataTransfer = <DataTransfer>(event.