A nanoscopic progress bar. Featuring realistic trickle animations to convince your users that something is happening!
## Usage
Add NgProgressModule
to NgModule imports
array.
import { NgProgressModule } from 'ng2-progressbar';
@NgModule({
imports: [
NgProgressModule
]
})
In your template
<ng-progress></ng-progress>
Add NgProgressService
wherever you want to use the progressbar.
import {NgProgressService} from "ng2-progressbar";
@Component({
})
constructor(private pService: NgProgressService) {
}
ngOnInit(){
this.pService.start();
this.http.get(url).subscribe(res){
this.pService.done();
}
}
NgProgressService options (functions):
-
NgProgressService.start()
Shows the progress bar
-
NgProgressService.set(n)
Sets a percentage n (where n is between 0-1)
-
NgProgressService.inc(n)
Increments by n (where n is between 0-1)
-
NgProgressService.done()
Completes the progress
NgProgressComponent options (inputs):
<ng-progress [positionUsing]="'marginLeft'" [minimum]="0.15" [maximum]="1"
[speed]="'200'" [showSpinner]="'false'" [direction]="'rightToLeftIncreased'"
[color]="'red'" [trickleSpeed]="250" [thick]="false" [ease]="'linear'"
></ng-progress>
- [minimum]: between
0.0
to 1.0
.
Progress initial starting value, default 0.08
- [maximum]: between
0.0
to 1.0
.
Progress initial starting value, default 0.08