Created
May 30, 2018 11:25
-
-
Save nitinbhojwani/5d4212e408bd46a7d9932499a4abe5f1 to your computer and use it in GitHub Desktop.
Typescript to create and download file at client
This file contains hidden or 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
| downloadFile(dataToBeDownloaded): void { | |
| let a = document.createElement("a"); | |
| let dataURI = "data:text/plain;base64," + btoa(dataToBeDownloaded); | |
| a.href = dataURI; | |
| a['download'] = this._sddcInformation.id + ".pem"; | |
| a.click(); | |
| a.remove(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment