I have used angular-file-saver to download a file in my application but I'm stuck with,how i can implement the same while downloading from the server and saving the file in the existing form.
My controller.js
vm.download = function(data){
vm.ProjectId = workspaceService.getSelectedWorkSpaceDeal().id;
manageRFPService.getFieldData(vm.ProjectId).then(function(data){
vm.downloading = data;
var down = new Blob([vm.downloading],{ type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(down,'documentname.txt');
}); };
the response in the data contains a file name but the file is not downloading with its extension rather just an response is getting downloaded in text form.
my Html
<td><a ng-href=" " ng-click="vm.download( )">{{uploading.documentname}}</a>
If the above getting response is similar for multiple object display