File

protocol-lwm2m/formly/lwm2m-file-pick-and-replace.type.component.ts

Extends

FieldType

Metadata

Index

Properties
Methods

Constructor

constructor(service: Lwm2mConfigurationService<>, fileService: FilesService, alertService: AlertService)
Parameters :
Name Type Optional
service Lwm2mConfigurationService<> No
fileService FilesService No
alertService AlertService No

Methods

onFocus
onFocus()
Returns : void
onPick
onPick(event)
Parameters :
Name Optional
event No
Returns : void
remove
remove()
Returns : void

Properties

picker
Type : ElementRef<HTMLInputElement>
Decorators :
@ViewChild('picker', {static: false})
<div class="input-group">
  <input
    class="form-control"
    [class.is-invalid]="showError"
    [type]="'text'"
    [formControl]="formControl"
    [formlyAttributes]="field"
    [required]="props.required"
    [disabled]="props.disabled"
    readonly
  />
  <div class="input-group-btn a-i-end">
    <button
      class="btn btn-primary btn-block"
      title="{{ 'Replace' | translate }}"
      type="button"
      (click)="onFocus()"
      [disabled]="props.disabled"
    >
      <i c8yIcon="replace"></i>
      <input
        class="hidden"
        id="file"
        type="file"
        accept=".pem"
        #picker
        (change)="onPick($event)"
      />
    </button>
    <button
      class="btn btn-danger btn-block"
      title="{{ 'Remove' | translate }}"
      type="button"
      (click)="remove()"
      [disabled]="props.disabled"
    >
      <i c8yIcon="minus-circle"></i>
    </button>
  </div>
</div>

results matching ""

    No results matching ""