File

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

Description

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

<c8y-li>
  <c8y-li-checkbox></c8y-li-checkbox>
</c8y-li>

Extends

CheckboxControlValueAccessor

Metadata

Index

Methods
Inputs
Outputs

Constructor

constructor(renderer: Renderer2, elementRef: ElementRef)
Parameters :
Name Type Optional
renderer Renderer2 No
elementRef ElementRef No

Inputs

disabled
Type : boolean
Default value : false

Indicates if the checkbox is disabled.

displayAsSwitch
Type : boolean
Default value : false
selected
Type : boolean
Default value : false

Indicates if the checkbox is selected.

Outputs

onSelect
Type : EventEmitter

An event emitted as soon as the checkbox is selected.

Methods

select
select(value)

Selects the checkbox.

Parameters :
Name Optional Description
value No

The value to pass.

Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)
Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
writeValue
writeValue(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
<label [ngClass]="displayAsSwitch ? 'c8y-switch c8y-switch--inline' : 'c8y-checkbox'">
  <input
    type="checkbox"
    class="form-control"
    [disabled]="disabled"
    [checked]="selected"
    (change)="select($event.target.checked); (false)"
  />
  <span></span>
</label>
<ng-content></ng-content>

results matching ""

    No results matching ""