1.0.3 • Published 5 years ago
eko-checkbox v1.0.3
Getting Started
EkoCheckbox contains the checkbox input with a small slider design, to work is required to have Bootstrap 3 or 4.
Installation instructions
Install eko-checkbox
from npm
:
npm install eko-checkbox --save
Add import package to app.module.ts
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