File

repository/shared/file-download/file-download.component.ts

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(repositoryService: RepositoryService, inventoryBinaryService: InventoryBinaryService, alertService: AlertService)
Parameters :
Name Type Optional
repositoryService RepositoryService No
inventoryBinaryService InventoryBinaryService No
alertService AlertService No

Inputs

url
Type : string

Methods

determineBehavior
determineBehavior()
Decorators :
@memoize()
Returns : LinkRenderType
Async downloadFile
downloadFile()
Returns : any
getBinaryName$
getBinaryName$(binaryUrl)
Decorators :
@memoize()
Parameters :
Name Optional
binaryUrl No
Returns : any

Properties

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>

results matching ""

    No results matching ""