-
-
Save cloudmanic/92adaaffed4216985233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploader.bind('afteraddingall', function (event, items) { | |
// Loop through all the files and add their preview image to | |
// the item object. This way we cain call "src" in the dom. | |
// <img src="{{item.src}}" /> for example. | |
angular.forEach($scope.uploader.queue, function(value, key) | |
{ | |
var type = value.file.type; | |
if(uploader.hasHTML5 && ((type == 'image/jpeg') || (type == 'image/png'))) | |
{ | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
$scope.uploader.queue[key].src = e.target.result; | |
$scope.$apply(); | |
} | |
reader.readAsDataURL(value.file); | |
} | |
}); | |
});); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr ng-repeat="item in uploader.queue"> | |
<td> | |
<img id="blah" src="{{item.src}}" width="50" alt="your image" /> | |
<strong>{{ item.file.name }}</strong> | |
</tr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment