How to change the AngularJS avatar using storage image? [closed]

1

Creating an app with AngularJS and would like the user to choose a photo of their storage to insert as an image of their profile, that is, I want to search the image in the internal memory. Is it possible?

$scope.pegaArquivo = function (files) {
    var imgLocal = document.getElementById('imgLocal')
    var file = files[0];
    var img = document.createElement("img");
    img.file = file;

    localStorage.setItem('object',JSON.stringify(file)); 
    this.quickOrder.push(JSON.parse(localStorage.getItem('object')));
    return file;

    imgLocal.appendChild(img)

    var reader = new FileReader();
    reader.onload = (function (aImg) { return function (e) { aImg.src = e.target.result; }; })(img);
    reader.readAsDataURL(file);
}
    
asked by anonymous 03.11.2016 / 03:29

0 answers