core/color-input/color-input.component.ts
ControlValueAccessor
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ColorInputComponent), multi: true
}
|
selector | c8y-color-input |
standalone | true |
imports |
FormsModule
|
templateUrl | ./color-input.component.html |
Properties |
Methods |
registerOnChange | ||||||
registerOnChange(fn: (value: string) => void)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: () => void)
|
||||||
Parameters :
Returns :
void
|
Optional setDisabledState | ||||||
setDisabledState(isDisabled: boolean)
|
||||||
Parameters :
Returns :
void
|
valueChange | ||||||
valueChange(value: string)
|
||||||
Parameters :
Returns :
void
|
writeValue | ||||||
writeValue(obj: string)
|
||||||
Parameters :
Returns :
void
|
currentValue |
Type : string
|
isDisabled |
Default value : false
|
<div class="input-group">
<div class="color-input form-control">
<div class="c8y-colorpicker">
<input
type="color"
[disabled]="isDisabled"
[ngModelOptions]="{ standalone: true }"
[ngModel]="currentValue"
(ngModelChange)="valueChange($event)"
/>
<span [style.background-color]="currentValue"></span>
</div>
</div>
<input
class="form-control"
type="text"
[disabled]="isDisabled"
[ngModelOptions]="{ standalone: true }"
[ngModel]="currentValue"
(ngModelChange)="valueChange($event)"
/>
</div>