ang-slide-toggle
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "ang-slide-toggle", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^8.2.13", |
@@ -1,24 +0,70 @@ | ||
# AngSlideToggle | ||
# Angular 8+ slider toggle | ||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.13. | ||
![alt text](https://i.ibb.co/QpgC7jd/toggles.jpg) | ||
## Code scaffolding | ||
## Getting Started | ||
Run `ng generate component component-name --project ang-slide-toggle` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ang-slide-toggle`. | ||
> Note: Don't forget to add `--project ang-slide-toggle` or else it will be added to the default project in your `angular.json` file. | ||
## Build | ||
### Installation | ||
Run `ng build ang-slide-toggle` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
- Install the package : | ||
`npm install ang-slider-toggle --save` | ||
## Publishing | ||
After building your library with `ng build ang-slide-toggle`, go to the dist folder `cd dist/ang-slide-toggle` and run `npm publish`. | ||
### Usage | ||
## Running unit tests | ||
Import `AngSlideToggleModule` into `NgModule` in `app.module.ts`. `CommonModule` is also required. | ||
```js | ||
Run `ng test ang-slide-toggle` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
## Further help | ||
import { AngSlideToggleModule } from 'ang-slider-toggle'; | ||
import { CommonModule } from '@angular/common'; | ||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). | ||
@NgModule({ | ||
// ... | ||
imports: [ | ||
AngSlideToggleModule, | ||
CommonModule | ||
] | ||
// ... | ||
}) | ||
``` | ||
Add the following component tag in you template | ||
```html | ||
<ang-slider-toggle [sliderSettings]='settings' [checked]="true" [disabled]="false"></ang-slider-toggle> | ||
``` | ||
settings | ||
```js | ||
settings = { | ||
barCheckedBgColor: '#beebe9', | ||
sliderCheckedColor: '#3fc5f0', | ||
barUncheckedBgColor: '#ded5d5', | ||
sliderUncheckedColor: '#bdbdbd' | ||
} | ||
``` | ||
or | ||
```html | ||
<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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51999
71