repository/shared/file-download/file-download.component.ts
selector | c8y-file-download |
templateUrl | ./file-download.component.html |
Properties |
Methods |
Inputs |
constructor(repositoryService: RepositoryService, inventoryBinaryService: InventoryBinaryService, alertService: AlertService)
|
||||||||||||
Parameters :
|
url |
Type : string
|
determineBehavior |
determineBehavior()
|
Decorators :
@memoize()
|
Returns :
LinkRenderType
|
Async downloadFile |
downloadFile()
|
Returns :
any
|
getBinaryName$ | ||||
getBinaryName$(binaryUrl)
|
||||
Decorators :
@memoize()
|
||||
Parameters :
Returns :
any
|
isDownloading |
Default value : false
|
linkRenderType |
Default value : LinkRenderType
|
<a
*ngIf="determineBehavior() === linkRenderType.LINK"
href="{{ url }}"
class="pointer"
target="_blank"
rel="noopener noreferrer"
>
{{ getBinaryName$(url) | async }}
</a>
<span *ngIf="determineBehavior() === linkRenderType.TEXTONLY">{{
getBinaryName$(url) | async
}}</span>
<span *ngIf="determineBehavior() === linkRenderType.DOWNLOAD">
<a *ngIf="!isDownloading" class="pointer" (click)="downloadFile()">
{{ getBinaryName$(url) | async }}
</a>
<span *ngIf="isDownloading">
<i c8yIcon="spinner" class="icon-spin"></i> {{ 'Downloading…' | translate }}
</span>
</span>