Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
Angular: cómo almacenar contenido de FileReader en una variable o una matriz

Estoy tan confundido acerca de esto, pero ¿hay alguna manera de almacenar el contenido de FileReader en una variable o una matriz tal como está, porque necesito ese contenido en otro componente?

Este es mi fragmento de código:

 fileChangeListener($event: any): void { this.fileSize = Math.round($event.target.files[0].size /1024) + 'KB'; this.fileName = $event.target.files[0].name; this.fileType = $event.target.files[0].type; this.filelastModifiedDate = new Date($event.target.files[0].lastModified).toLocaleDateString(); console.log(this.fileName, this.fileType); console.log('submitted here'); const file = $event.target.files[0]; const fileReader = new FileReader(); fileReader.onload = (e) => { const data = fileReader.result; this.storeResults(data); this._fileReader = data; // console.log('FileREAAAAAAAAAAADER \n', data); console.log(this._fileReader); this.parseData(data); }; return fileReader.readAsText(file); }

componente.html:

 <mat-form-field (change)="fileChangeListener($event)"> <ngx-mat-file-input formControlName="multiplefile" placeholder="Multiple inputs" multiple></ngx-mat-file-input> <mat-icon matSuffix>folder</mat-icon> </mat-form-field>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!