Trying to read binary as string in IE10/11 and it fails. Works in Chrome. Have tried diffrent IE-fixes but no succes. I seems that the biggest problem is that i can't find the result. It gives error in angular/cli": "1.6.5".
e.target.result return null and is not accepted in compiler
FileReader.prototype.readAsBinaryString = function(blb) {
const that = this;
const conversor = function (e) {
const toConvert = e.target.result || '';
let binary = '';
const bytes = new Uint8Array(toConvert);
reader.result return null and is not accepted in compiler
if (FileReader.prototype.readAsBinaryString === undefined) {
FileReader.prototype.readAsBinaryString = function (fileData) {
let binary = '';
const pt = this;
reader.onload = function (e) {
const bytes = new Uint8Array(reader.result);
const length = bytes.byteLength;
for (let i = 0; i < length; i++) {
binary += String.fromCharCode(bytes[i]);
}
const fl = {target: {result: binary}};
pt.onload(fl);
};
reader.readAsArrayBuffer(fileData);
};
}
Have tried to parse it, compiler likes it but does not work.
const r: any = reader;
const t: any = e.target;
let data;
if (!e) {
data = r.content;
} else {
data = t.result;
}
Any ideas?