Created
December 21, 2014 17:30
-
-
Save endaaman/0fe1f7bb62b7d8d3e476 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
angular.module modulePage | |
.factory 'Download', | |
()-> | |
el = document.createElement 'a' | |
el.id = 'shodow-download-anchor' | |
el.style.display = 'none' | |
el.target = '_blank' | |
el.download = '' | |
document.body.appendChild el | |
(url, filename)-> | |
el.href = url | |
if filename | |
el.download = filename | |
el.click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment