docs(aio): add missing imports to interceptor example (#21259)
PR Close #21259
This commit is contained in:
parent
dcc3eba962
commit
03d16fcd24
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue