From 49e02ca7d691d9fb77ba2dd8d34cd93e0eeea3d9 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Tue, 23 Feb 2021 09:42:58 -0500 Subject: [PATCH] docs: move JsonParser class above CustomJsonInterceptor (#40964) This move fixes the error in StackBlitz of Cannot access 'JsonParser' before initialization PR Close #40964 --- .../app/http-interceptors/custom-json-interceptor.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aio/content/examples/http/src/app/http-interceptors/custom-json-interceptor.ts b/aio/content/examples/http/src/app/http-interceptors/custom-json-interceptor.ts index 42e63b25c8..073cf3eb30 100644 --- a/aio/content/examples/http/src/app/http-interceptors/custom-json-interceptor.ts +++ b/aio/content/examples/http/src/app/http-interceptors/custom-json-interceptor.ts @@ -3,6 +3,12 @@ import { Injectable } from '@angular/core'; import { map } from 'rxjs/operators'; // #docregion custom-json-interceptor +// The JsonParser class acts as a base class for custom parsers and as the DI token. +@Injectable() +export abstract class JsonParser { + abstract parse(text: string): any; +} + @Injectable() export class CustomJsonInterceptor implements HttpInterceptor { constructor(private jsonParser: JsonParser) {} @@ -31,12 +37,6 @@ export class CustomJsonInterceptor implements HttpInterceptor { } } } - -// The JsonParser class acts as a base class for custom parsers and as the DI token. -@Injectable() -export abstract class JsonParser { - abstract parse(text: string): any; -} // #enddocregion custom-json-interceptor // #docregion custom-json-parser