Skip to content

ValonHajredini/eko-checkbox

Repository files navigation

Getting Started

EkoCheckbox contains the checkbox input with a small slider design, to work is required to have Bootstrap 3* or 4*.

Installation instructions

Method 1

Install eko-checkbox from npm:

npm install eko-checkbox --save

Add needed package to NgModule imports:

import { EkoCheckboxModule } from 'eko-checkbox';

@NgModule({
  ...
  imports: [
  ...,
  EkoCheckboxModule,
  ...
  ]
  ...
})

To app.component.ts create the func tion to get data from eko-checkbox checkbox

export class AppComponent {
...
checkboxData(e) {
    console.log(e);
  }
...
}

To app.component.html add :

<eko-checkbox
  [fontSize]="'22px'"
  [color]="'#fff'"
  [value]="true"
  [name]="'myCheckbox'"
  (data)="checkboxData($event)"
>Check box</eko-checkbox>

if you provide the name [name]="'anyName'" the return data will be:

{name: 'anyName', value: true} 

or

{name: 'anyName', value: false} 

if you do not provide a name like:

<eko-checkbox
  [fontSize]="'22px'"
  [color]="'#fff'"
  [value]="true"
  (data)="checkboxData($event)"
>Check box</eko-checkbox>

the return value will be:

true 

or

false

About

npm package for Angular 4 +

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published