MCPcopy Index your code
hub / github.com/angular/angular / withRequestsMadeViaParent

Function withRequestsMadeViaParent

packages/common/http/src/provider.ts:273–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271 * @publicApi 19.0
272 */
273export function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.RequestsMadeViaParent> {
274 return makeHttpFeature(HttpFeatureKind.RequestsMadeViaParent, [
275 {
276 provide: HttpBackend,
277 useFactory: () => {
278 const handlerFromParent = inject(HttpHandler, {skipSelf: true, optional: true});
279 if (ngDevMode && handlerFromParent === null) {
280 throw new Error(
281 'withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient',
282 );
283 }
284 return handlerFromParent;
285 },
286 },
287 ]);
288}
289
290/**
291 * Configures the current `HttpClient` instance to make requests using the fetch API.

Callers 1

provider_spec.tsFile · 0.90

Calls 2

injectFunction · 0.90
makeHttpFeatureFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…