File

shared/src/on-off-control-base/on-off-control-base.component.ts

Description

Abstract component for building on-off-controls (e.g. checkbox).

Extends

ControlBaseDirective

Implements

ControlValueAccessor

Index

Inputs
Accessors

Inputs

checked
Type : boolean

Determines whether the control is checked.

Note: Typically the checked property determines the state of the control presented to the user. In case of the <talenra-checkbox>, the displayed state depends on checked and determinate state, while the latter takes precedence.

value
Type : boolean

The native element's value attribute. Setting the value will update the checked state of the control (false → unchecked/off, true → checked/on).

Note: A native checkbox element's value and checked state do not neccessarily align. However, the on-off-controls in this library (e.g. <talenra-checkbox>, <talenra-toggle>) keep the control's value and checked state in sync.

label
Type : string
Default value : ''

Label displayed to the user.

disabled
Type : boolean

Determinates whether the control is en-/disabled.

formControlName
Type : string
Default value : ''

Name of the corresponding FormControl if used in a reactive form context.

readonly
Type : boolean, unknown
Default value : false, { transform: booleanAttribute }

Determines whether the control is readonly.

Accessors

checked
getchecked()

Determines whether the control is checked.

Note: Typically the checked property determines the state of the control presented to the user. In case of the <talenra-checkbox>, the displayed state depends on checked and determinate state, while the latter takes precedence.

Returns : boolean
setchecked(value: boolean)

Set whether the control is checked.

Parameters :
Name Type Optional
value boolean No
Returns : void
value
getvalue()

The native element's value attribute. Setting the value will update the checked state of the control (false → unchecked/off, true → checked/on).

Note: A native checkbox element's value and checked state do not neccessarily align. However, the on-off-controls in this library (e.g. <talenra-checkbox>, <talenra-toggle>) keep the control's value and checked state in sync.

setvalue(value: boolean)

Set the control's value.

Parameters :
Name Type Optional
value boolean No
Returns : void

results matching ""

    No results matching ""