1
I have a function that runs while performing the upload of files, however I am having an error in result
within the function onload
.
This mistake makes no sense because if I give one console.log
in the result
the result appears clearly, so it seems to me a false positive before the angular compiler, who accuses the error and does not compile the program.
In order to run I am commenting on that line and removing the comment, why for some reason after the application running it accuses the error but not seriously enough to stop it.
async uploadFile(event) {
var reader = new FileReader();
let file = event.target.files[0];
reader.onload = ((file: any) => {
return (e: Event) => {
let result = e.srcElement.result;
//aqui acontece o erro e impede de compilar mas não existe erro de fato.
}
})(file);
reader.readAsText(file);
}
I’ll take your example, thank you.
– Sabrina