I'm new to coding and have the opportunity to do some small stories on a project to whet my teeth. Right now I'm working on getting profile picture selection and cropping into a webapp with AngularJS. I've selected ngImgCropper to handle the cropping. Here's a JSFiddle with boilerplate code: http://jsfiddle.net/a2ew3yhf/50/
And here's JavaScript from that link:
var handleFileSelect=function(evt) {
var file=evt.currentTarget.files[0];
var reader = new FileReader();
reader.onload = function (evt) {
$scope.$apply(function($scope){
$scope.myImage = evt.currentTarget.result;
});
};
reader.readAsDataURL(file);
};
Here's my problem. My project uses Typescript, which doesn't support evt.currentTarget.result, so I get the following error:
Property 'result' does not exist on type 'EventTarget'
Is there any way to get around this?