()
| 281 | * @publicApi 19.0 |
| 282 | */ |
| 283 | export function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.RequestsMadeViaParent> { |
| 284 | return makeHttpFeature(HttpFeatureKind.RequestsMadeViaParent, [ |
| 285 | { |
| 286 | provide: HttpBackend, |
| 287 | useFactory: () => { |
| 288 | const handlerFromParent = inject(HttpHandler, {skipSelf: true, optional: true}); |
| 289 | if (ngDevMode && handlerFromParent === null) { |
| 290 | throw new Error( |
| 291 | 'withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient', |
| 292 | ); |
| 293 | } |
| 294 | return handlerFromParent; |
| 295 | }, |
| 296 | }, |
| 297 | ]); |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * Configures the current `HttpClient` instance to make requests using the fetch API. |
no test coverage detected