I have a fileload method the code works when I use it separately from my project, but once I integrate it with my angular 5 projects it doesn't work
Error:
Code:
MM.Backend.File.load = function() {
var promise = new Promise();
this.input.type = "file";
this.input.onchange = function(e) {
var file = e.target.files[0];
if (!file) { return; }
var reader = new FileReader();
reader.onload = function() { promise.fulfill({data:reader.result, name:file.name}); }
reader.onerror = function() { promise.reject(reader.error); }
reader.readAsText(file);
}.bind(this);
this.input.click();
return promise;
}