angularjs - How to preview image before upload with ng-file-upload -
this code snippet.
when user select file clicking on change image button, file gets selected , name displayed in text box.
<img src="" alt="" border=3 height=75 width=75><br><br> <input type="text" ng-model="b.files[0].name" data-ng-hide="!uploadmode" readonly="readonly"> <button ngf-select ng-model="b.files" class="btn btn-success btn-sm" ng-click="uploadmode=1"> <span class="glyphicon glyphicon-picture"></span> change image </button>
i want display image of selected file preview user, before actual upload.
can please 1 me, changes need that?
take @ example (ngthumb
directive). basically, it's using filereader api , listening appropriate events.
Comments
Post a Comment