[ADF-686] add blobFile as input (#1933)

This commit is contained in:
Maurizio Vitale
2017-06-05 21:33:20 +01:00
committed by Eugenio Romano
parent 033c0f0a6b
commit 23fbc8f858
3 changed files with 32 additions and 5 deletions

View File

@@ -16,6 +16,7 @@
*/
import { Component, Input } from '@angular/core';
import { ContentService } from 'ng2-alfresco-core';
@Component({
selector: 'not-supported-format',
@@ -30,10 +31,21 @@ export class NotSupportedFormat {
@Input()
urlFile: string;
@Input()
blobFile: Blob;
constructor(private contentService: ContentService) {
}
/**
* Download file opening it in a new window
*/
download() {
window.open(this.urlFile);
if (this.urlFile) {
window.open(this.urlFile);
} else {
this.contentService.downloadBlob(this.blobFile, this.nameFile);
}
}
}