File

core/list-group/list-item-radio.component.ts

Description

A component to display a radio button in a c8y-li. Use it with content projection. It can be used standalone or with an ngModel.

<c8y-li>
  <c8y-li-radio></c8y-li-radio>
</c8y-li>

Implements

ControlValueAccessor

Metadata

Index

Methods
Inputs
Outputs

Inputs

disabled
Type : boolean
Default value : false

Indicates if the radio is disabled.

name
Type : string
Default value : 'list_item_radio'

The name of the radio (use different names for different radio groups).

selected
Type : boolean
Default value : false

Indicates if the radio is selected.

value
Type : any

The current value.

Outputs

onSelect
Type : EventEmitter

An event emitted as soon as the radio is selected.

Methods

change
change(checked)

Triggered when the radio is changed.

Parameters :
Name Optional Description
checked No

Should it be checked or not?

Returns : void
registerOnChange
registerOnChange(fn: any)

Registers an onChange event.

Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)

Registers an onTouch event.

Parameters :
Name Type Optional
fn any No
Returns : void
reset
reset()

Resets the native radio element.

Returns : void
<label class="c8y-radio">
  <input
    #radio
    type="radio"
    [name]="name"
    [checked]="selected"
    (change)="change($event.target.checked); (false)"
    [disabled]="disabled"
  />
  <span></span>
</label>
<ng-content></ng-content>

results matching ""

    No results matching ""