From 0439bcf93c33302a8d50edbb9ef503f888fc9a91 Mon Sep 17 00:00:00 2001 From: Henrique Schmitt Date: Mon, 26 Mar 2018 15:58:22 -0300 Subject: [PATCH] fix on profile image upload --- src/app/pages/profile/ProfilePageCtrl.js | 4 ++-- src/app/theme/directives/ngFileSelect.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/pages/profile/ProfilePageCtrl.js b/src/app/pages/profile/ProfilePageCtrl.js index c271490..b50877a 100644 --- a/src/app/pages/profile/ProfilePageCtrl.js +++ b/src/app/pages/profile/ProfilePageCtrl.js @@ -76,8 +76,8 @@ }); }; - $scope.getFile = function () { - fileReader.readAsDataUrl($scope.file, $scope) + $scope.getFile = function (file) { + fileReader.readAsDataUrl(file, $scope) .then(function (result) { $scope.picture = result; }); diff --git a/src/app/theme/directives/ngFileSelect.js b/src/app/theme/directives/ngFileSelect.js index a255d60..894d2bb 100644 --- a/src/app/theme/directives/ngFileSelect.js +++ b/src/app/theme/directives/ngFileSelect.js @@ -10,7 +10,7 @@ link: function ($scope, el) { el.bind('change', function (e) { $scope.file = (e.srcElement || e.target).files[0]; - $scope.getFile(); + $scope.getFile($scope.file); }) } }