I am sending a downloadable file from backend to AngularJS. Whenever a GET request (with some data as parameters) is made to the "/report" url, the server sends a file that I want to receive in AngularJS. Ideally, a browser should prompt user for saving/opening a file that server sends. So far I have done this:
$scope.getReport = function () {
console.log("getReport");
var report_url = '/report';
var some_data = "asdf";
$http({method:'GET', url:report_url, data=some_data})
.success(function(data) {
});
};
Now I am unable to figure out how to get the file that server sent me.