mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-686] add blobFile as input (#1933)
This commit is contained in:
committed by
Eugenio Romano
parent
033c0f0a6b
commit
23fbc8f858
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user