Fixed - insead of wrapping te reader.onloadend in a scope.$apply() add a
scope.$digest():
.directive("uploadFile",["$parse",function($parse){
return {
restrict: 'A',
link: function(scope,element,attrs){
element.bind('change',function() {
var file = element[0].files[0];
var reader = new FileReader();
reader.onloadend = function () {
scope.item.fileSrc = reader.result;
scope.item.fileName = file.name;
scope.item.fileType = file.type;
scope.item.fileSize = file.size;
scope.$digest();
}
reader.readAsDataURL(file);
})
}
}
}])
Why this is I dunno but it works...
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.