()
| 271 | * @publicApi 19.0 |
| 272 | */ |
| 273 | export 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. |
no test coverage detected
searching dependent graphs…