Skip to content

🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar

License

Notifications You must be signed in to change notification settings

mpalourdio/ng-http-loader

Repository files navigation

Build Status

ng-http-loader

Installation

To install this library, run:

$ npm install ng-http-loader --save

What does it do ?

This package provides an HTTP Interceptor, and a spinner component. The HTTP interceptor listens to all HTTP requests and shows a spinner during pending requests.

Usage

In order to have this module listening to your http requests, replace all your http uses by http: HttpInterceptorService. Then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; [...] import { AppComponent } from './app.component'; import { NgHttpLoaderModule } from 'ng-http-loader/ng-http-loader.module'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, NgHttpLoaderModule, ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

In your app.component.html, add :

<spinner></spinner>

Requirements

It's compatible with Angular 4+.

Credits

The spinner has been taken from SpinKit.

About

🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 7