savefile imeplementation

This commit is contained in:
Kyle Spearrin 2018-06-08 12:23:46 -04:00
parent 3de3c7a189
commit b34e511ddc
2 changed files with 12 additions and 2 deletions

View File

@ -74,7 +74,18 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
}
saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {
//
const blob = new Blob([blobData], blobOptions);
if (navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, fileName);
} else {
const a = win.document.createElement('a');
a.href = win.URL.createObjectURL(blob);
a.download = fileName;
a.style.position = 'fixed';
win.document.body.appendChild(a);
a.click();
win.document.body.removeChild(a);
}
}
getApplicationVersion(): string {

View File

@ -24,5 +24,4 @@ export class WebStorageService implements StorageService {
window.sessionStorage.removeItem(key);
return Promise.resolve();
}
}