How to make FileReader work with Angular2!!
When reading a file from client side with Angular2 and Typescript,
I try to us
Just add
fr.readAsText(event.files[0]);
After the onLoad definition.
Maybe this can help you, this is my upload handler function for the file upload library of primeng
archivoUploadHandler(event) {
let contenido;
let fr = new FileReader();
fr.onload = (e) => {
contenido = fr.result;
console.log(contenido);
};
fr.readAsText(event.files[0]);
}