kit-check

README

Scope

  • Button groups
  • Toolbars

API

[class] KitCheckDirective

@Directive

Selector:'[kitCheck]'

Adds to any element ValueAccessor and checkbox/radio behavior.

When is checked - adds class "checked" to the element.

For a value changing the directive listen click event. Directive implements ControlValueAccessor interface and changes ngModel value on click event.

Usage

Emit checkboxes behavior:

<button kitCheck [(ngModel)]="buttonModel1">Checkbox button 1</button>
<button kitCheck [(ngModel)]="buttonModel2">Checkbox button 2</button>
<button kitCheck [(ngModel)]="buttonModel3">Checkbox button 3</button>

Emit radio behavior

<button kitCheck [(ngModel)]="buttonModel" [value]="1">Radio button 1</button>
<button kitCheck [(ngModel)]="buttonModel" [value]="2">Radio button 2</button>
<button kitCheck [(ngModel)]="buttonModel" [value]="3">Radio button 3</button>

Example

Members

SignatureDescription
@Input() checkedClass = 'checked'

Class applied when active.

@Input() value: any

Value that passed to VALUE_ACCESSOR.

Enables radio-behavior.

[class] KitCheckModule

@NgModule

Exports:[ KitCheckDirective, ]