Created
September 6, 2017 16:16
-
-
Save cironunes/e8d586e3124799b58159a1a011037dae to your computer and use it in GitHub Desktop.
Loading interceptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpInterceptor, HttpEvent, HttpRequest, HttpHandler } from '@angular/common/http'; | |
import { Observable } from 'rxjs/Observable'; | |
export class LoadingInterceptor implements HttpInterceptor { | |
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | |
const loadingReq = req.clone({ | |
reportProgress: true | |
}); | |
return next.handle(loadingReq); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment