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:
parent
d3705b3284
commit
49e02ca7d6
@ -3,6 +3,12 @@ import { Injectable } from '@angular/core';
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
// #docregion custom-json-interceptor
|
// #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()
|
@Injectable()
|
||||||
export class CustomJsonInterceptor implements HttpInterceptor {
|
export class CustomJsonInterceptor implements HttpInterceptor {
|
||||||
constructor(private jsonParser: JsonParser) {}
|
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
|
// #enddocregion custom-json-interceptor
|
||||||
|
|
||||||
// #docregion custom-json-parser
|
// #docregion custom-json-parser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user