docs(aio): add missing imports to interceptor example (#21259)

PR Close #21259
This commit is contained in:
courtneypattison 2018-01-02 09:49:49 -08:00 committed by Kara Erickson
parent dcc3eba962
commit 03d16fcd24
1 changed files with 4 additions and 0 deletions

View File

@ -273,6 +273,8 @@ has a single `intercept()` method. Here is a simple interceptor which does nothi
import {Injectable} from '@angular/core';
import {HttpEvent, HttpInterceptor, HttpHandler, HttpRequest} from '@angular/common/http';
import {Observable} from 'rxjs/Observable';
@Injectable()
export class NoopInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
@ -297,6 +299,8 @@ Simply declaring the `NoopInterceptor` above doesn't cause your app to use it. Y
import {NgModule} from '@angular/core';
import {HTTP_INTERCEPTORS} from '@angular/common/http';
import {NoopInterceptor} from 'noop.interceptor.ts';
@NgModule({
providers: [{
provide: HTTP_INTERCEPTORS,