I want to show spinner before the image is downloaded in its preview thumbnail after I choose photo to upload. I am using angularjs so I am trying to realize it with ng-show. Like when the image is not downloaded yet I set the $scope.showImage = false
and change this param to true only when it is downloaded. I saw solution here but i don't know how to get image src.
Thanks!
EDIT. Actually this is an upload form. I show the image before upload. I use Danial Farid's library. My code is below:
<div ng-show="spin">
<div id="spinner"></div>
</div>
<div ng-show="files" class="thumbnail col-lg-10 col-lg-offset-1">
<img id="imgId" src="#" alt="my image">
</div>
And this is in controller:
$scope.onFileSelect = function($files) {
$scope.spin = true;
$scope.files = $files;
};