qwc/projects/qwc/src/lib/components/qwc-toggle/qwc-toggle.component.ts
Render qwc-toggle and handle its events.
ControlValueAccessor
AfterViewInit
| providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: QwcToggle, multi: true,
}
|
| selector | qwc-toggle |
| templateUrl | ./qwc-toggle.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(_elementRef: ElementRef, renderer: Renderer2)
|
|||||||||
|
Parameters :
|
| ariaDescription |
Type : string | null
|
Default value : null
|
|
Used to set the aria-description attribute on the underlying input element. |
| ariaLabel |
Type : string | null
|
Default value : null
|
|
Used to set the aria-label attribute on the underlying input element. |
| ariaLabelledby |
Type : string | null
|
Default value : null
|
|
Used to set the aria-labelledby attribute on the underlying input element. |
| emitOnInitialChange |
Default value : true
|
|
Used to skip initial change. |
| inputId |
Default value : ""
|
| inputLabel |
Default value : ""
|
| value |
|
Used to set current state of qwc-toggle |
| valueChange |
Type : EventEmitter
|
| coerceBooleanProperty | ||||||||
coerceBooleanProperty(value: any)
|
||||||||
|
Coerce boolean property
Parameters :
Returns :
boolean
boolean |
| getHostElement |
getHostElement()
|
|
Get host element
Returns :
any
ElementRef |
| hasHostAttributes | ||||||||
hasHostAttributes(...attributes: string[])
|
||||||||
|
Host attributes
Parameters :
Returns :
any
string[] |
| ngAfterViewInit |
ngAfterViewInit()
|
|
Component lifecycle hook
Returns :
void
void |
| registerOnChange | ||||||||
registerOnChange(fn: (_: any) => void)
|
||||||||
|
Register on change
Parameters :
Returns :
void
void |
| registerOnTouched | ||||||||
registerOnTouched(fn: () => void)
|
||||||||
|
Register on touched
Parameters :
Returns :
void
void |
| setDisabledState | ||||||||
setDisabledState(isDisabled: boolean)
|
||||||||
|
Set disabled state
Parameters :
Returns :
void
void |
| toggle |
toggle()
|
|
Changes the state of qwc-toggle
Returns :
void
void |
| updateHostAttribute | ||||||
updateHostAttribute(value)
|
||||||
|
Update host attribute
Parameters :
Returns :
void
void |
| writeValue | ||||||
writeValue(value: boolean)
|
||||||
|
WriteValue, registerOnChange, registerOnTouched functions are a part of the ControlValueAccessor interface. These allow for the implementation of logic which gets implemented when a value is written, changed or the input field is touched.
Parameters :
Returns :
void
|
| checkBoxElement |
Type : any
|
Decorators :
@ViewChild('checkBoxEl')
|
| value | ||||
setvalue(val)
|
||||
|
Parameters :
Returns :
void
|
| disabled |
getdisabled()
|
|
Used to set disabled attribute upon underlying input element. |