File

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

Metadata

selector c8y-file-download
templateUrl ./file-download.component.html

Index

Properties
Methods
Inputs

Constructor

constructor(repositoryService: RepositoryService, inventoryBinaryService: InventoryBinaryService)
Parameters :
Name Type Optional
repositoryService RepositoryService No
inventoryBinaryService InventoryBinaryService 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

linkRenderType
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>

<a *ngIf="determineBehavior() === linkRenderType.DOWNLOAD" class="pointer" (click)="downloadFile()">
    {{getBinaryName$(url) | async}}
</a>

result-matching ""

    No results matching ""