var handleFileSelect=function(evt) {
var file = evt.currentTarget.files[0];//reader.result,evt.target.result;
var reader = new FileReader();
reader.onload = function (evt) {
scope.$apply(function(scope){
scope.myImage = evt.target.result;
});
};
reader.readAsDataURL(file);
};
element.find('#fileInput').on('change',handleFileSelect);
base64转文件
如图片
var avatarImage = new Image();
avatarImage.src = baseData;