ngx-counter-input
v1.0.0
Published
Counter for Angular. - Works with Reactive Forms! π - Compatible with Angular 9 π
Downloads
11
Readme
NGX Counter π
Counter for Angular.
- Works with Reactive Forms! π
- Compatible with Angular 9 π
Installation π¨
Add in app.module.ts
import { NgxCounterInputModule } from 'ngx-counter-input';
Dependencies:
$ npm install --save @fortawesome/fontawesome-free
$ npm i bootstrap
Styling π
To change the colors of the controls:
.time-controls {
background-color: #new-color !important;
color: #new-color !important;
}
Options π§±
| Option | Type | | ------ | ------ | | step | Number - Increment or decrease of the number | | counterRangeMin | Number - Counter minimum | | counterRangeMax | Number - Counter maximum | | counterValue | Number - Initial value |
Example π¬
Reactive Forms:
<form [formGroup]="formulario">
<ngx-counter-input formControlName="time" [step]="15" [counterRangeMin]="15" [counterRangeMax]="240" [counterValue]="15"></ngx-counter>
</form>
NgModel:
<ngx-counter-input [(ngModel)]="time" [step]="15" [counterRangeMin]="15" [counterRangeMax]="240" [counterValue]="15"></ngx-counter>