alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.ts
ControlValueAccessor
Validator
OnInit
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AlarmEventAttributesFormComponent), multi: true
}
{
provide: NG_VALIDATORS, useExisting: forwardRef(() => AlarmEventAttributesFormComponent), multi: true
}
|
selector | c8y-alarm-event-attributes-form |
templateUrl | ./alarm-event-attributes-form.component.html |
Properties |
Methods |
Inputs |
constructor(formBuilder: FormBuilder, alarmEventAttributesFormService: AlarmEventAttributesFormService)
|
|||||||||
Parameters :
|
omitProperties |
Type : OmitSelectorProperties
|
Default value : {}
|
selectedItems |
Type : AlarmOrEvent[]
|
Default value : []
|
timelineType |
Type : TimelineType
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Parameters :
Returns :
void
|
setDisabledState | ||||||
setDisabledState(isDisabled: boolean)
|
||||||
Parameters :
Returns :
void
|
validate | ||||||
validate(_control: AbstractControl)
|
||||||
Parameters :
Returns :
ValidationErrors
|
writeValue | ||||||
writeValue(obj: any)
|
||||||
Parameters :
Returns :
void
|
formGroup |
Type : FormGroup
|
<div [formGroup]="formGroup">
<c8y-form-group *ngIf="formGroup.controls.label">
<label class="m-0">{{ 'Label' | translate }}</label>
<input
class="form-control flex-grow"
name="label"
formControlName="label"
[placeholder]="
'e.g. {{ example }}'
| translate
: {
example: timelineType === 'ALARM' ? 'Alarm unavailable' : 'Location update'
}
"
/>
</c8y-form-group>
<div formGroupName="filters">
<c8y-form-group>
<label class="m-0">{{ 'Type' | translate }}</label>
<input
class="form-control flex-grow"
name="type"
formControlName="type"
[placeholder]="
'e.g. {{ example }}'
| translate
: {
example:
timelineType === 'ALARM' ? 'c8y_UnavailabilityAlarm' : 'c8y_LocationUpdate'
}
"
/>
<c8y-messages>
<c8y-message
name="duplicateType"
[text]="'Type already used.' | translate"
></c8y-message>
</c8y-messages>
</c8y-form-group>
</div>
</div>