Answer the question
In order to leave comments, you need to log in
Type 'ArrayBuffer' cannot be assigned to type 'string'?
I am writing applications using angular6 and node.js, I ran into a problem, now I am writing the part that is responsible for uploading images to the server, I created a variable (yes, it is empty by default)imagePreview= ""
ERROR in src/app/categories-page/categories-form/categories-form.component.ts(74,7): error TS2322: Type 'string | ArrayBuffer' is not assignable to type 'string'.
[1] Type 'ArrayBuffer' is not assignable to type 'string'.
reader.onload = () => {
this.imagePreview = reader.result
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question