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.
```html
* <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
|
Indicates if the radio is disabled.
Type :
Default value : |
name
|
The name of the radio (use different names for different radio groups).
Default value : |
selected
|
Indicates if the radio is selected.
Default value : |
value
|
The current value.
Type : |
onSelect
|
An event emitted as soon as the radio is selected. $event Type: EventEmitter
|
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>