Skip to content

Instantly share code, notes, and snippets.

@ocReaper
Last active December 18, 2015 22:20
Show Gist options
  • Save ocReaper/5bc68467fc874a179c2d to your computer and use it in GitHub Desktop.
Save ocReaper/5bc68467fc874a179c2d to your computer and use it in GitHub Desktop.
Blob file download in Angular.js using $resource Part 1
(function () {
'use strict';
angular
.module('app')
.factory('Email', Email);
function Email($resource) {
var url = 'emails/'
, EmailBase;
EmailBase = $resource(url + ':emailId', {emailId: '@id'}, {
getFile: {
method: 'GET',
url: url + ':emailId/files/:fileName',
params: {
emailId: '@id',
fileName: '@fileName'
},
cache: false
}
});
return EmailBase;
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment