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.

Implements

ControlValueAccessor

Example

```html
 * <c8y-li>
 *   <c8y-li-radio></c8y-li-radio>
 * </c8y-li>
 * ```

Metadata

host {
}
providers { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => ListItemRadioComponent) }
selector c8y-list-item-radio, c8y-li-radio
templateUrl ./list-item-radio.component.html

Index

Methods
Inputs
Outputs

Inputs

disabled

Indicates if the radio is disabled.

Type : boolean

Default value : false

name

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

Default value : 'list_item_radio'

selected

Indicates if the radio is selected.

Default value : false

value

The current value.

Type : any

Outputs

onSelect

An event emitted as soon as the radio is selected.

$event Type: EventEmitter

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>

result-matching ""

    No results matching ""