MCPcopy Create free account
hub / github.com/angular/angular / JsonpInterceptor

Class JsonpInterceptor

packages/common/http/src/jsonp.ts:334–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 */
333@Injectable()
334export class JsonpInterceptor {
335 constructor(private injector: EnvironmentInjector) {}
336
337 /**
338 * Identifies and handles a given JSONP request.
339 * @param initialRequest The outgoing request object to handle.
340 * @param next The next interceptor in the chain, or the backend
341 * if no interceptors remain in the chain.
342 * @returns An observable of the event stream.
343 */
344 intercept(initialRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
345 return runInInjectionContext(this.injector, () =>
346 jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)),
347 );
348 }
349}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected