2
rated 0 times
[
8]
[
6]
/ answers: 1 / hits: 94669
/ 11 Years ago, mon, september 16, 2013, 12:00:00
Is it possible to read files in AngularJS? I want to place the file into an HTML5 canvas to crop.
I was thinking of using a directive? This is the javascript code I want to put into my directive:
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
More From » angularjs