CheckboxComponent
class
A compact, VS-Code-like checkbox built on a native <input type="checkbox">.
Replaces ng-zorro's nz-checkbox. It implements ControlValueAccessor
so it works with [(ngModel)] (and reactive forms), projects its label text
through <ng-content>, and exposes a checkedChange output (renamed from
nzCheckedChange).
Properties
| Name | Type | Description |
|---|---|---|
checked (readonly) |
WritableSignal<boolean> |
Current checked state (source of truth for the view). |
checkedChange (readonly) |
EventEmitter<boolean> |
Emits the new checked value whenever the user toggles the checkbox. |
focusedByKeyboard (readonly) |
WritableSignal<boolean> |
True only when focus arrived via the keyboard, so a focus ring is shown. |
inputId (readonly) |
string |
Unique id shared between the native input (allows external <label for> if ever needed). |
isDisabled (readonly) |
WritableSignal<boolean> |
Whether the control is disabled (driven by the input or by reactive forms). |
disabled |
unknown |
handleChange()
Signature
handleChange(event: Event): voidParameters
event(Event)
Returns
void
ngAfterViewInit()
Signature
ngAfterViewInit(): voidReturns
void
ngOnDestroy()
Signature
ngOnDestroy(): voidReturns
void
registerOnChange()
Signature
registerOnChange(fn: (value: boolean) => void): voidParameters
fn((value: boolean) => void) - The callback function to register
Returns
void
registerOnTouched()
Signature
registerOnTouched(fn: () => void): voidParameters
fn(() => void) - The callback function to register
Returns
void
setDisabledState()
Signature
setDisabledState(isDisabled: boolean): voidParameters
isDisabled(boolean) - The disabled status to set on the element
Returns
void
writeValue()
Signature
writeValue(value: unknown): voidParameters
value(unknown)
Returns
void