0
如何在AngularJS中的$on("fileSelected")
之後顯示圖像?
我使用下列選擇一個文件:
$scope.$on("fileSelected", function (event, args) {
debugger;
$scope.$apply(function() {
$scope.file = args.file;
});
我需要顯示與IMG src
屬性的圖像。
非常感謝:)玉米粥VAR –
讀卡器=新的FileReader(); reader.onload = function(e){('#image')。attr('src',e.target.result); } reader.readAsDataURL(index.file); –