@angular/common 18.0.0-rc.0 → 18.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/esm2022/http/src/client.mjs +3 -3
  2. package/esm2022/http/src/fetch.mjs +3 -3
  3. package/esm2022/http/src/interceptor.mjs +4 -15
  4. package/esm2022/http/src/jsonp.mjs +6 -6
  5. package/esm2022/http/src/module.mjs +12 -12
  6. package/esm2022/http/src/private_export.mjs +2 -2
  7. package/esm2022/http/src/provider.mjs +8 -13
  8. package/esm2022/http/src/xhr.mjs +3 -3
  9. package/esm2022/http/src/xsrf.mjs +6 -6
  10. package/esm2022/http/testing/src/backend.mjs +3 -3
  11. package/esm2022/http/testing/src/module.mjs +4 -4
  12. package/esm2022/src/common_module.mjs +4 -4
  13. package/esm2022/src/directives/ng_class.mjs +3 -3
  14. package/esm2022/src/directives/ng_component_outlet.mjs +3 -3
  15. package/esm2022/src/directives/ng_for_of.mjs +3 -3
  16. package/esm2022/src/directives/ng_if.mjs +3 -3
  17. package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
  18. package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +3 -3
  19. package/esm2022/src/directives/ng_optimized_image/preconnect_link_checker.mjs +3 -3
  20. package/esm2022/src/directives/ng_optimized_image/preload-link-creator.mjs +3 -3
  21. package/esm2022/src/directives/ng_plural.mjs +6 -6
  22. package/esm2022/src/directives/ng_style.mjs +3 -3
  23. package/esm2022/src/directives/ng_switch.mjs +9 -9
  24. package/esm2022/src/directives/ng_template_outlet.mjs +3 -3
  25. package/esm2022/src/i18n/localization.mjs +6 -6
  26. package/esm2022/src/location/hash_location_strategy.mjs +3 -3
  27. package/esm2022/src/location/location.mjs +3 -3
  28. package/esm2022/src/location/location_strategy.mjs +6 -6
  29. package/esm2022/src/location/platform_location.mjs +6 -6
  30. package/esm2022/src/navigation/platform_navigation.mjs +3 -3
  31. package/esm2022/src/pipes/async_pipe.mjs +3 -3
  32. package/esm2022/src/pipes/case_conversion_pipes.mjs +9 -9
  33. package/esm2022/src/pipes/date_pipe.mjs +4 -6
  34. package/esm2022/src/pipes/i18n_plural_pipe.mjs +3 -3
  35. package/esm2022/src/pipes/i18n_select_pipe.mjs +3 -3
  36. package/esm2022/src/pipes/json_pipe.mjs +3 -3
  37. package/esm2022/src/pipes/keyvalue_pipe.mjs +3 -3
  38. package/esm2022/src/pipes/number_pipe.mjs +9 -9
  39. package/esm2022/src/pipes/slice_pipe.mjs +3 -3
  40. package/esm2022/src/version.mjs +1 -1
  41. package/esm2022/testing/src/location_mock.mjs +3 -3
  42. package/esm2022/testing/src/mock_location_strategy.mjs +3 -3
  43. package/esm2022/testing/src/mock_platform_location.mjs +6 -6
  44. package/esm2022/upgrade/src/location_upgrade_module.mjs +4 -4
  45. package/fesm2022/common.mjs +117 -119
  46. package/fesm2022/common.mjs.map +1 -1
  47. package/fesm2022/http/testing.mjs +8 -8
  48. package/fesm2022/http.mjs +44 -60
  49. package/fesm2022/http.mjs.map +1 -1
  50. package/fesm2022/testing.mjs +16 -16
  51. package/fesm2022/upgrade.mjs +5 -5
  52. package/http/index.d.ts +1 -9
  53. package/http/testing/index.d.ts +1 -1
  54. package/index.d.ts +1 -1
  55. package/package.json +2 -2
  56. package/testing/index.d.ts +1 -1
  57. package/upgrade/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-rc.0
2
+ * @license Angular v18.0.0-rc.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -311,10 +311,10 @@ class HttpClientTestingBackend {
311
311
  return `Match by function: ${matcher.name}`;
312
312
  }
313
313
  }
314
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
315
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend }); }
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
315
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingBackend }); }
316
316
  }
317
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
318
318
  type: Injectable
319
319
  }] });
320
320
  function describeRequest(testRequest) {
@@ -342,11 +342,11 @@ function provideHttpClientTesting() {
342
342
  * @deprecated Add `provideHttpClientTesting()` to your providers instead.
343
343
  */
344
344
  class HttpClientTestingModule {
345
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
346
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] }); }
347
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] }); }
345
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
346
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] }); }
347
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] }); }
348
348
  }
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, decorators: [{
349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientTestingModule, decorators: [{
350
350
  type: NgModule,
351
351
  args: [{
352
352
  imports: [HttpClientModule],
package/fesm2022/http.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-rc.0
2
+ * @license Angular v18.0.0-rc.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1454,10 +1454,10 @@ class HttpClient {
1454
1454
  put(url, body, options = {}) {
1455
1455
  return this.request('PUT', url, addBody(options, body));
1456
1456
  }
1457
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
1458
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient }); }
1457
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
1458
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClient }); }
1459
1459
  }
1460
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient, decorators: [{
1460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClient, decorators: [{
1461
1461
  type: Injectable
1462
1462
  }], ctorParameters: () => [{ type: HttpHandler }] });
1463
1463
 
@@ -1663,10 +1663,10 @@ class FetchBackend {
1663
1663
  }
1664
1664
  return chunksAll;
1665
1665
  }
1666
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1667
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend }); }
1666
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1667
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: FetchBackend }); }
1668
1668
  }
1669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend, decorators: [{
1669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: FetchBackend, decorators: [{
1670
1670
  type: Injectable
1671
1671
  }] });
1672
1672
  /**
@@ -1702,9 +1702,7 @@ function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
1702
1702
  * injector.
1703
1703
  */
1704
1704
  function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
1705
- // clang-format off
1706
1705
  return (initialRequest, finalHandlerFn) => runInInjectionContext(injector, () => interceptorFn(initialRequest, (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)));
1707
- // clang-format on
1708
1706
  }
1709
1707
  /**
1710
1708
  * A multi-provider token that represents the array of registered
@@ -1721,10 +1719,6 @@ const HTTP_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? 'HTTP_INTERCEPTOR_FN
1721
1719
  * A multi-provided token of `HttpInterceptorFn`s that are only set in root.
1722
1720
  */
1723
1721
  const HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : '');
1724
- /**
1725
- * A provider to set a global primary http backend. If set, it will override the default one
1726
- */
1727
- const PRIMARY_HTTP_BACKEND = new InjectionToken(ngDevMode ? 'PRIMARY_HTTP_BACKEND' : '');
1728
1722
  // TODO(atscott): We need a larger discussion about stability and what should contribute to stability.
1729
1723
  // Should the whole interceptor chain contribute to stability or just the backend request #55075?
1730
1724
  // Should HttpClient contribute to stability automatically at all?
@@ -1768,11 +1762,6 @@ class HttpInterceptorHandler extends HttpHandler {
1768
1762
  this.chain = null;
1769
1763
  this.pendingTasks = inject(ɵPendingTasks);
1770
1764
  this.contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
1771
- // Check if there is a preferred HTTP backend configured and use it if that's the case.
1772
- // This is needed to enable `FetchBackend` globally for all HttpClient's when `withFetch`
1773
- // is used.
1774
- const primaryHttpBackend = inject(PRIMARY_HTTP_BACKEND, { optional: true });
1775
- this.backend = primaryHttpBackend ?? backend;
1776
1765
  // We strongly recommend using fetch backend for HTTP calls when SSR is used
1777
1766
  // for an application. The logic below checks if that's the case and produces
1778
1767
  // a warning otherwise.
@@ -1811,10 +1800,10 @@ class HttpInterceptorHandler extends HttpHandler {
1811
1800
  return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
1812
1801
  }
1813
1802
  }
1814
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1815
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler }); }
1803
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1804
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpInterceptorHandler }); }
1816
1805
  }
1817
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
1806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
1818
1807
  type: Injectable
1819
1808
  }], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
1820
1809
 
@@ -2014,10 +2003,10 @@ class JsonpClientBackend {
2014
2003
  foreignDocument ??= this.document.implementation.createHTMLDocument();
2015
2004
  foreignDocument.adoptNode(script);
2016
2005
  }
2017
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2018
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend }); }
2006
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2007
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpClientBackend }); }
2019
2008
  }
2020
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
2009
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpClientBackend, decorators: [{
2021
2010
  type: Injectable
2022
2011
  }], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
2023
2012
  type: Inject,
@@ -2055,10 +2044,10 @@ class JsonpInterceptor {
2055
2044
  intercept(initialRequest, next) {
2056
2045
  return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2057
2046
  }
2058
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2059
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor }); }
2047
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2048
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpInterceptor }); }
2060
2049
  }
2061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
2050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: JsonpInterceptor, decorators: [{
2062
2051
  type: Injectable
2063
2052
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2064
2053
 
@@ -2338,10 +2327,10 @@ class HttpXhrBackend {
2338
2327
  });
2339
2328
  }));
2340
2329
  }
2341
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
2342
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend }); }
2330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
2331
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXhrBackend }); }
2343
2332
  }
2344
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
2333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXhrBackend, decorators: [{
2345
2334
  type: Injectable
2346
2335
  }], ctorParameters: () => [{ type: i1.XhrFactory }] });
2347
2336
 
@@ -2390,10 +2379,10 @@ class HttpXsrfCookieExtractor {
2390
2379
  }
2391
2380
  return this.lastToken;
2392
2381
  }
2393
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
2394
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor }); }
2382
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
2383
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfCookieExtractor }); }
2395
2384
  }
2396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2397
2386
  type: Injectable
2398
2387
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2399
2388
  type: Inject,
@@ -2436,10 +2425,10 @@ class HttpXsrfInterceptor {
2436
2425
  intercept(initialRequest, next) {
2437
2426
  return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2438
2427
  }
2439
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2440
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor }); }
2428
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2429
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfInterceptor }); }
2441
2430
  }
2442
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2443
2432
  type: Injectable
2444
2433
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2445
2434
 
@@ -2508,7 +2497,12 @@ function provideHttpClient(...features) {
2508
2497
  HttpXhrBackend,
2509
2498
  HttpInterceptorHandler,
2510
2499
  { provide: HttpHandler, useExisting: HttpInterceptorHandler },
2511
- { provide: HttpBackend, useExisting: HttpXhrBackend },
2500
+ {
2501
+ provide: HttpBackend,
2502
+ useFactory: () => {
2503
+ return inject(FetchBackend, { optional: true }) ?? inject(HttpXhrBackend);
2504
+ },
2505
+ },
2512
2506
  {
2513
2507
  provide: HTTP_INTERCEPTOR_FNS,
2514
2508
  useValue: xsrfInterceptorFn,
@@ -2650,24 +2644,14 @@ function withRequestsMadeViaParent() {
2650
2644
  /**
2651
2645
  * Configures the current `HttpClient` instance to make requests using the fetch API.
2652
2646
  *
2653
- * This `FetchBackend` requires the support of the Fetch API which is available on all evergreen
2654
- * browsers and on NodeJS from v18 onward.
2655
- *
2656
2647
  * Note: The Fetch API doesn't support progress report on uploads.
2657
2648
  *
2658
2649
  * @publicApi
2659
2650
  */
2660
2651
  function withFetch() {
2661
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof fetch !== 'function') {
2662
- // TODO: Create a runtime error
2663
- // TODO: Use ENVIRONMENT_INITIALIZER to contextualize the error message (browser or server)
2664
- throw new Error('The `withFetch` feature of HttpClient requires the `fetch` API to be available. ' +
2665
- 'If you run the code in a Node environment, make sure you use Node v18.10 or later.');
2666
- }
2667
2652
  return makeHttpFeature(HttpFeatureKind.Fetch, [
2668
2653
  FetchBackend,
2669
2654
  { provide: HttpBackend, useExisting: FetchBackend },
2670
- { provide: PRIMARY_HTTP_BACKEND, useExisting: FetchBackend },
2671
2655
  ]);
2672
2656
  }
2673
2657
 
@@ -2709,9 +2693,9 @@ class HttpClientXsrfModule {
2709
2693
  providers: withXsrfConfiguration(options).ɵproviders,
2710
2694
  };
2711
2695
  }
2712
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2713
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule }); }
2714
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
2696
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2697
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientXsrfModule }); }
2698
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientXsrfModule, providers: [
2715
2699
  HttpXsrfInterceptor,
2716
2700
  { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
2717
2701
  { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
@@ -2722,7 +2706,7 @@ class HttpClientXsrfModule {
2722
2706
  { provide: XSRF_ENABLED, useValue: true },
2723
2707
  ] }); }
2724
2708
  }
2725
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2726
2710
  type: NgModule,
2727
2711
  args: [{
2728
2712
  providers: [
@@ -2748,11 +2732,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ng
2748
2732
  * @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
2749
2733
  */
2750
2734
  class HttpClientModule {
2751
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2752
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule }); }
2753
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] }); }
2735
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2736
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientModule }); }
2737
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] }); }
2754
2738
  }
2755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, decorators: [{
2739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientModule, decorators: [{
2756
2740
  type: NgModule,
2757
2741
  args: [{
2758
2742
  /**
@@ -2772,11 +2756,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ng
2772
2756
  * @deprecated `withJsonpSupport()` as providers instead
2773
2757
  */
2774
2758
  class HttpClientJsonpModule {
2775
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2776
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule }); }
2777
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] }); }
2759
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2760
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientJsonpModule }); }
2761
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] }); }
2778
2762
  }
2779
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.2", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2780
2764
  type: NgModule,
2781
2765
  args: [{
2782
2766
  providers: [withJsonpSupport().ɵproviders],
@@ -3055,5 +3039,5 @@ function verifyMappedOrigin(url) {
3055
3039
  * Generated bundle index. Do not edit.
3056
3040
  */
3057
3041
 
3058
- export { FetchBackend, HTTP_INTERCEPTORS, HTTP_TRANSFER_CACHE_ORIGIN_MAP, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HTTP_ROOT_INTERCEPTOR_FNS as ɵHTTP_ROOT_INTERCEPTOR_FNS, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, PRIMARY_HTTP_BACKEND as ɵPRIMARY_HTTP_BACKEND, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY, withHttpTransferCache as ɵwithHttpTransferCache };
3042
+ export { FetchBackend, HTTP_INTERCEPTORS, HTTP_TRANSFER_CACHE_ORIGIN_MAP, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HTTP_ROOT_INTERCEPTOR_FNS as ɵHTTP_ROOT_INTERCEPTOR_FNS, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY, withHttpTransferCache as ɵwithHttpTransferCache };
3059
3043
  //# sourceMappingURL=http.mjs.map