A fully automatic loading bar with zero configuration for angular app (http, http-client and router).
npm install @ngx-loading-bar/http --saveimport { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { LoadingBarHttpModule } from '@ngx-loading-bar/http';
import { AppComponent } from './app';
@NgModule({
imports: [
BrowserModule,
HttpModule,
LoadingBarHttpModule,
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
})
export class AppModule {
}import { Component } from '@angular/core';
@Component({
selector: 'app',
template: `
...
<ngx-loading-bar></ngx-loading-bar>
`,
})
export class AppComponent {}- @ngx-loading-bar/router - Display loading bar when navigating between routes.
- @ngx-loading-bar/http-client - Display the progress of your
@angular/common/httprequests. - @ngx-loading-bar/core - Core module to manage the progress bar manually.