all I’m getting this typerror, and I can’t figure it out. I’ve searched Google, but I can’t seem to find an answer.
TypeError: Argument 1 (‘blob’) to FileReader.readAsDataURL must be an
instance of Blob
here is my component method:
onFilePick(event: Event) {
const file = (event.target as HTMLInputElement).files;
//console.log(file);
// console.log(this.form);
this.form.patchValue({ Image: file });
this.form.get('image')?.updateValueAndValidity();
const reader: any = new FileReader();
reader.onload = () => {
this.imagePreview = reader.result;
};
return reader.readAsDataURL(file);
}