Good day!
I can't resolve my problem - create link to download attachment.
A file I receive from SOAP service in xml and consequently I must create a
link to download file.
What I have now:
In controller:
//creating comments
for (var index in $scope.comments){
var com = $scope.comments[index]
if (com.z2AF_Work_Log01_attachmentName !== undefined
){
var a = document.createElement('a');
a.target = '_blank';
a.download = com.z2AF_Work_Log01_attachmentName
;
a.innerText = com.z2AF_Work_Log01_attachmentName
;
var blob = new Blob([ atob(com.
z2AF_Work_Log01_attachmentData) ],
{ type : 'zip' });
//com.href = (window.URL ||
window.webkitURL).createObjectURL( blob );
a.href = (window.URL || window.webkitURL).
createObjectURL( blob );;
com.attachment_link = a.outerHTML;
}
}
Links created, but if I have not plain text (csv) a file after download is
broken. When I download csv - all fine.
In template:
.attach ng-bind-html="comment.attachment_link | notSanit"
Thanks.
--
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.