ang-slide-toggle
v0.0.2
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.13.
Downloads
2
Maintainers
Readme
Angular 8+ slider toggle
Getting Started
Installation
- Install the package :
npm install ang-slider-toggle --save
Usage
Import AngSlideToggleModule
into NgModule
in app.module.ts
. CommonModule
is also required.
import { AngSlideToggleModule } from 'ang-slider-toggle';
import { CommonModule } from '@angular/common';
@NgModule({
// ...
imports: [
AngSlideToggleModule,
CommonModule
]
// ...
})
Add the following component tag in you template
<ang-slider-toggle [sliderSettings]='settings' [checked]="true" [disabled]="false"></ang-slider-toggle>
settings
settings = {
barCheckedBgColor: '#beebe9',
sliderCheckedColor: '#3fc5f0',
barUncheckedBgColor: '#ded5d5',
sliderUncheckedColor: '#bdbdbd'
}
or
<ang-slider-toggle
barCheckedBgColor="#beebe9"
sliderCheckedColor="#3fc5f0"
barUncheckedBgColor="#ded5d5",
sliderUncheckedColor="#bdbdbd"
[checked]="true"
[disabled]="false">
</ang-slider-toggle>
Run locally
- Clone the repository or downlod the .zip,.tar files.
- Run
npm install
- Run
ng serve
for a dev server - Navigate to
http://localhost:4200/
License
free to use on any purpose.