widgets/implementations/device-control-message/device-control-message-widget-view/device-control-message-widget-view.component.ts
OnChanges
DynamicComponent
OnDestroy
OnInit
selector | c8y-device-control-message-widget-view |
standalone | true |
imports |
CoreModule
ReactiveFormsModule
|
templateUrl | ./device-control-message-widget-view.component.html |
Properties |
Methods |
Inputs |
constructor(alert: AlertService, operation: OperationService, translate: TranslateService, dashboard: ContextDashboardComponent)
|
|||||||||||||||
Parameters :
|
config |
Type : literal type
|
ngOnChanges |
ngOnChanges()
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Async sendMessage |
sendMessage()
|
Returns :
any
|
alerts |
Type : DynamicComponentAlertAggregator
|
messageToBeSent |
Type : string
|
Default value : ''
|
operationSupportedByDevice$ |
Type : Observable<boolean>
|
<div *ngIf="operationSupportedByDevice$ | async" class="input-group p-16">
<input
type="text"
class="form-control"
data-cy="c8y-device-control-message-widget-view--message-textbox"
[(ngModel)]="messageToBeSent"
placeholder="{{ 'Message' | translate }}"
/>
<span class="input-group-btn">
<button
title="{{ 'Send' | translate }}"
class="btn btn-primary"
data-cy="c8y-device-control-message-widget-view--send-button"
(click)="sendMessage()"
[disabled]="!messageToBeSent"
translate
>
Send
</button>
</span>
</div>