How to make FileReader work with Angular2!!
When reading a file from client side with Angular2 and Typescript,
I try to use FileReader in this way:
var fileReader = new FileReader();
fileReader.onload = function(e) {
console.log("run fileReader.onload");
// ......
}
But it doesn't work at all, this 'fileReader.onload' function will never be called.
Really need a solution for reading files, please help. Thanks
Check this from an online IDE:
Just add
After the onLoad definition.
Maybe this can help you, this is my upload handler function for the file upload library of primeng