docs: move JsonParser class above CustomJsonInterceptor (#40964)

This move fixes the error in StackBlitz of
Cannot access 'JsonParser' before initialization

PR Close #40964
This commit is contained in:
Kapunahele Wong 2021-02-23 09:42:58 -05:00 committed by atscott
parent d3705b3284
commit 49e02ca7d6
1 changed files with 6 additions and 6 deletions

View File

@ -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