Good afternoon.
I'm having this error - this.fileLoad.then is not a function, could someone please explain to me why this is occurring?
fileLoad(){
return new Promise((resolve, reject) =>{
let fileReader = new FileReader();
let fieldFile = [...this.formID].find(element =>{
if(element.type === "file"){
return element.files;
}
});
fileReader.onload = () =>{
fileReader.result;
resolve(fileReader);
}
fileReader.onerror = () =>{
reject("erro");
}
fileReader.readAsDataURL(fieldFile.files[0]);
}
)};
this.fileLoad.then(
(content)=>{
console.log(content);
},
(e)=>{
console.log(e);
})
Uncaught TypeError: this.fileLoad.then is not a function at userController.addUser (userController.js: 76) at userController.loadFiles (userController.js: 57) at HTMLDocument.document.addEventListener.event (userController.js: 20)