core/list-group/list-item-radio.component.ts
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>
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 |
Methods |
Inputs |
Outputs |
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. |
onSelect |
Type : EventEmitter
|
An event emitted as soon as the radio is selected. |
change | ||||||
change(checked)
|
||||||
Triggered when the radio is changed.
Parameters :
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Registers an onChange event.
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Registers an onTouch event.
Parameters :
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>