protocol-lwm2m/formly/lwm2m-file-pick-and-replace.type.component.ts
FieldType
selector | c8y-lwm2m-file-pick-replace-type |
templateUrl | ./lwm2m-file-pick-and-replace.type.component.html |
Properties |
Methods |
constructor(service: Lwm2mConfigurationService<>, fileService: FilesService, alertService: AlertService)
|
||||||||||||
Parameters :
|
onFocus |
onFocus()
|
Returns :
void
|
onPick | ||||
onPick(event)
|
||||
Parameters :
Returns :
void
|
remove |
remove()
|
Returns :
void
|
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>