Reputation: 595
I am using angular 4. And trying to add loading bar, till I didn't get the response from the server side. When Request gets complete, it should not hide. For this I am using below code In module.ts:
import { NgProgressModule } from 'ngx-progressbar';
@NgModule({
imports: [
NgProgressModule
]
)}
And in Html file I am using below:
<ng-progress [positionUsing]="'marginLeft'"
[direction]="'leftToRightIncreased'"
[color]="'#4286f4'" [trickleSpeed]="500"
[thick]="true" [ease]="'easeInSine'" ></ng-progress>
Upvotes: 1
Views: 1505
Reputation: 222700
In components, wherever you need the progress bar, you have to
import { NgProgress } from 'ngx-progressbar';
and
constructor(private ngProgress: NgProgress) {
}
use start()
and stop()
as you need
this.ngProgress.start();
Upvotes: 1