@angular/common 16.1.0-next.2 → 16.1.0-rc.0
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.
- package/esm2022/http/public_api.mjs +3 -2
- package/esm2022/http/src/client.mjs +5 -6
- package/esm2022/http/src/fetch.mjs +225 -0
- package/esm2022/http/src/headers.mjs +14 -16
- package/esm2022/http/src/interceptor.mjs +14 -9
- package/esm2022/http/src/jsonp.mjs +9 -11
- package/esm2022/http/src/module.mjs +16 -19
- package/esm2022/http/src/provider.mjs +27 -1
- package/esm2022/http/src/request.mjs +3 -1
- package/esm2022/http/src/response.mjs +3 -1
- package/esm2022/http/src/transfer_cache.mjs +4 -7
- package/esm2022/http/src/xhr.mjs +6 -43
- package/esm2022/http/src/xsrf.mjs +9 -11
- package/esm2022/http/testing/src/backend.mjs +5 -6
- package/esm2022/http/testing/src/module.mjs +6 -7
- package/esm2022/src/common_module.mjs +6 -7
- package/esm2022/src/directives/ng_class.mjs +5 -6
- package/esm2022/src/directives/ng_component_outlet.mjs +5 -6
- package/esm2022/src/directives/ng_for_of.mjs +5 -6
- package/esm2022/src/directives/ng_if.mjs +5 -6
- package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +5 -6
- package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +7 -8
- package/esm2022/src/directives/ng_optimized_image/preconnect_link_checker.mjs +5 -6
- package/esm2022/src/directives/ng_optimized_image/preload-link-creator.mjs +5 -6
- package/esm2022/src/directives/ng_plural.mjs +9 -11
- package/esm2022/src/directives/ng_style.mjs +5 -6
- package/esm2022/src/directives/ng_switch.mjs +13 -16
- package/esm2022/src/directives/ng_template_outlet.mjs +5 -6
- package/esm2022/src/i18n/localization.mjs +9 -11
- package/esm2022/src/location/hash_location_strategy.mjs +5 -6
- package/esm2022/src/location/location.mjs +5 -6
- package/esm2022/src/location/location_strategy.mjs +9 -11
- package/esm2022/src/location/platform_location.mjs +9 -11
- package/esm2022/src/pipes/async_pipe.mjs +17 -10
- package/esm2022/src/pipes/case_conversion_pipes.mjs +13 -16
- package/esm2022/src/pipes/date_pipe.mjs +5 -6
- package/esm2022/src/pipes/i18n_plural_pipe.mjs +5 -6
- package/esm2022/src/pipes/i18n_select_pipe.mjs +5 -6
- package/esm2022/src/pipes/json_pipe.mjs +5 -6
- package/esm2022/src/pipes/keyvalue_pipe.mjs +5 -6
- package/esm2022/src/pipes/number_pipe.mjs +13 -16
- package/esm2022/src/pipes/slice_pipe.mjs +5 -6
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/src/viewport_scroller.mjs +2 -3
- package/esm2022/testing/src/location_mock.mjs +5 -6
- package/esm2022/testing/src/mock_location_strategy.mjs +5 -6
- package/esm2022/testing/src/mock_platform_location.mjs +5 -6
- package/esm2022/upgrade/src/location_upgrade_module.mjs +6 -7
- package/fesm2022/common.mjs +128 -120
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +8 -8
- package/fesm2022/http/testing.mjs.map +1 -1
- package/fesm2022/http.mjs +302 -96
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +10 -10
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +5 -5
- package/fesm2022/upgrade.mjs.map +1 -1
- package/http/index.d.ts +49 -3
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +2 -2
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2022/http.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.1.0-
|
|
2
|
+
* @license Angular v16.1.0-rc.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { Injectable, InjectionToken,
|
|
8
|
+
import { Injectable, inject, InjectionToken, ɵInitialRenderPendingTasks, Inject, ɵRuntimeError, PLATFORM_ID, makeEnvironmentProviders, NgModule, TransferState, makeStateKey, ɵENABLED_SSR_FEATURES, APP_BOOTSTRAP_LISTENER, ApplicationRef } from '@angular/core';
|
|
9
9
|
import { of, Observable, from } from 'rxjs';
|
|
10
|
-
import { concatMap, filter, map, switchMap, tap, first } from 'rxjs/operators';
|
|
10
|
+
import { concatMap, filter, map, finalize, switchMap, tap, first } from 'rxjs/operators';
|
|
11
11
|
import * as i1 from '@angular/common';
|
|
12
12
|
import { DOCUMENT, ɵparseCookieValue } from '@angular/common';
|
|
13
13
|
|
|
@@ -80,6 +80,12 @@ class HttpHeaders {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
else if (typeof Headers !== 'undefined' && headers instanceof Headers) {
|
|
84
|
+
this.headers = new Map();
|
|
85
|
+
headers.forEach((values, name) => {
|
|
86
|
+
this.setHeaderEntries(name, values);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
83
89
|
else {
|
|
84
90
|
this.lazyInit = () => {
|
|
85
91
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
@@ -87,21 +93,7 @@ class HttpHeaders {
|
|
|
87
93
|
}
|
|
88
94
|
this.headers = new Map();
|
|
89
95
|
Object.entries(headers).forEach(([name, values]) => {
|
|
90
|
-
|
|
91
|
-
if (typeof values === 'string') {
|
|
92
|
-
headerValues = [values];
|
|
93
|
-
}
|
|
94
|
-
else if (typeof values === 'number') {
|
|
95
|
-
headerValues = [values.toString()];
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
headerValues = values.map((value) => value.toString());
|
|
99
|
-
}
|
|
100
|
-
if (headerValues.length > 0) {
|
|
101
|
-
const key = name.toLowerCase();
|
|
102
|
-
this.headers.set(key, headerValues);
|
|
103
|
-
this.maybeSetNormalizedName(name, key);
|
|
104
|
-
}
|
|
96
|
+
this.setHeaderEntries(name, values);
|
|
105
97
|
});
|
|
106
98
|
};
|
|
107
99
|
}
|
|
@@ -259,6 +251,12 @@ class HttpHeaders {
|
|
|
259
251
|
break;
|
|
260
252
|
}
|
|
261
253
|
}
|
|
254
|
+
setHeaderEntries(name, values) {
|
|
255
|
+
const headerValues = (Array.isArray(values) ? values : [values]).map((value) => value.toString());
|
|
256
|
+
const key = name.toLowerCase();
|
|
257
|
+
this.headers.set(key, headerValues);
|
|
258
|
+
this.maybeSetNormalizedName(name, key);
|
|
259
|
+
}
|
|
262
260
|
/**
|
|
263
261
|
* @internal
|
|
264
262
|
*/
|
|
@@ -724,6 +722,8 @@ class HttpRequest {
|
|
|
724
722
|
*
|
|
725
723
|
* Progress events are expensive (change detection runs on each event) and so
|
|
726
724
|
* they should only be requested if the consumer intends to monitor them.
|
|
725
|
+
*
|
|
726
|
+
* Note: The `FetchBackend` doesn't support progress report on uploads.
|
|
727
727
|
*/
|
|
728
728
|
this.reportProgress = false;
|
|
729
729
|
/**
|
|
@@ -934,6 +934,8 @@ var HttpEventType;
|
|
|
934
934
|
HttpEventType[HttpEventType["Sent"] = 0] = "Sent";
|
|
935
935
|
/**
|
|
936
936
|
* An upload progress event was received.
|
|
937
|
+
*
|
|
938
|
+
* Note: The `FetchBackend` doesn't support progress report on uploads.
|
|
937
939
|
*/
|
|
938
940
|
HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress";
|
|
939
941
|
/**
|
|
@@ -1371,13 +1373,226 @@ class HttpClient {
|
|
|
1371
1373
|
put(url, body, options = {}) {
|
|
1372
1374
|
return this.request('PUT', url, addBody(options, body));
|
|
1373
1375
|
}
|
|
1374
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
1375
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
1376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1377
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClient }); }
|
|
1376
1378
|
}
|
|
1377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
1379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClient, decorators: [{
|
|
1378
1380
|
type: Injectable
|
|
1379
1381
|
}], ctorParameters: function () { return [{ type: HttpHandler }]; } });
|
|
1380
1382
|
|
|
1383
|
+
const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
|
|
1384
|
+
const REQUEST_URL_HEADER = `X-Request-URL`;
|
|
1385
|
+
/**
|
|
1386
|
+
* Determine an appropriate URL for the response, by checking either
|
|
1387
|
+
* response url or the X-Request-URL header.
|
|
1388
|
+
*/
|
|
1389
|
+
function getResponseUrl$1(response) {
|
|
1390
|
+
if (response.url) {
|
|
1391
|
+
return response.url;
|
|
1392
|
+
}
|
|
1393
|
+
// stored as lowercase in the map
|
|
1394
|
+
const xRequestUrl = REQUEST_URL_HEADER.toLocaleLowerCase();
|
|
1395
|
+
return response.headers.get(xRequestUrl);
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* Uses `fetch` to send requests to a backend server.
|
|
1399
|
+
*
|
|
1400
|
+
* This `FetchBackend` requires the support of the
|
|
1401
|
+
* [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) which is available on all
|
|
1402
|
+
* supported browsers and on Node.js v18 or later.
|
|
1403
|
+
*
|
|
1404
|
+
* @see {@link HttpHandler}
|
|
1405
|
+
*
|
|
1406
|
+
* @publicApi
|
|
1407
|
+
* @developerPreview
|
|
1408
|
+
*/
|
|
1409
|
+
class FetchBackend {
|
|
1410
|
+
constructor() {
|
|
1411
|
+
// We need to bind the native fetch to its context or it will throw an "illegal invocation"
|
|
1412
|
+
this.fetchImpl = inject(FetchFactory, { optional: true })?.fetch ?? fetch.bind(globalThis);
|
|
1413
|
+
}
|
|
1414
|
+
handle(request) {
|
|
1415
|
+
return new Observable(observer => {
|
|
1416
|
+
const aborter = new AbortController();
|
|
1417
|
+
this.doRequest(request, aborter.signal, observer)
|
|
1418
|
+
.then(noop, error => observer.error(new HttpErrorResponse({ error })));
|
|
1419
|
+
return () => aborter.abort();
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
async doRequest(request, signal, observer) {
|
|
1423
|
+
const init = this.createRequestInit(request);
|
|
1424
|
+
let response;
|
|
1425
|
+
try {
|
|
1426
|
+
const fetchPromise = this.fetchImpl(request.url, { signal, ...init });
|
|
1427
|
+
// Make sure Zone.js doesn't trigger false-positive unhandled promise
|
|
1428
|
+
// error in case the Promise is rejected synchronously. See function
|
|
1429
|
+
// description for additional information.
|
|
1430
|
+
silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
|
|
1431
|
+
// Send the `Sent` event before awaiting the response.
|
|
1432
|
+
observer.next({ type: HttpEventType.Sent });
|
|
1433
|
+
response = await fetchPromise;
|
|
1434
|
+
}
|
|
1435
|
+
catch (error) {
|
|
1436
|
+
observer.error(new HttpErrorResponse({
|
|
1437
|
+
error,
|
|
1438
|
+
status: error.status ?? 0,
|
|
1439
|
+
statusText: error.statusText,
|
|
1440
|
+
url: request.url,
|
|
1441
|
+
headers: error.headers,
|
|
1442
|
+
}));
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const headers = new HttpHeaders(response.headers);
|
|
1446
|
+
const statusText = response.statusText;
|
|
1447
|
+
const url = getResponseUrl$1(response) ?? request.url;
|
|
1448
|
+
let status = response.status;
|
|
1449
|
+
let body = null;
|
|
1450
|
+
if (request.reportProgress) {
|
|
1451
|
+
observer.next(new HttpHeaderResponse({ headers, status, statusText, url }));
|
|
1452
|
+
}
|
|
1453
|
+
if (response.body) {
|
|
1454
|
+
// Read Progress
|
|
1455
|
+
const contentLength = response.headers.get('content-length');
|
|
1456
|
+
const chunks = [];
|
|
1457
|
+
const reader = response.body.getReader();
|
|
1458
|
+
let receivedLength = 0;
|
|
1459
|
+
let decoder;
|
|
1460
|
+
let partialText;
|
|
1461
|
+
while (true) {
|
|
1462
|
+
const { done, value } = await reader.read();
|
|
1463
|
+
if (done) {
|
|
1464
|
+
break;
|
|
1465
|
+
}
|
|
1466
|
+
chunks.push(value);
|
|
1467
|
+
receivedLength += value.length;
|
|
1468
|
+
if (request.reportProgress) {
|
|
1469
|
+
partialText = request.responseType === 'text' ?
|
|
1470
|
+
(partialText ?? '') + (decoder ??= new TextDecoder).decode(value, { stream: true }) :
|
|
1471
|
+
undefined;
|
|
1472
|
+
observer.next({
|
|
1473
|
+
type: HttpEventType.DownloadProgress,
|
|
1474
|
+
total: contentLength ? +contentLength : undefined,
|
|
1475
|
+
loaded: receivedLength,
|
|
1476
|
+
partialText,
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
// Combine all chunks.
|
|
1481
|
+
const chunksAll = this.concatChunks(chunks, receivedLength);
|
|
1482
|
+
try {
|
|
1483
|
+
body = this.parseBody(request, chunksAll);
|
|
1484
|
+
}
|
|
1485
|
+
catch (error) {
|
|
1486
|
+
// Body loading or parsing failed
|
|
1487
|
+
observer.error(new HttpErrorResponse({
|
|
1488
|
+
error,
|
|
1489
|
+
headers: new HttpHeaders(response.headers),
|
|
1490
|
+
status: response.status,
|
|
1491
|
+
statusText: response.statusText,
|
|
1492
|
+
url: getResponseUrl$1(response) ?? request.url,
|
|
1493
|
+
}));
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
// Same behavior as the XhrBackend
|
|
1498
|
+
if (status === 0) {
|
|
1499
|
+
status = body ? 200 /* HttpStatusCode.Ok */ : 0;
|
|
1500
|
+
}
|
|
1501
|
+
// ok determines whether the response will be transmitted on the event or
|
|
1502
|
+
// error channel. Unsuccessful status codes (not 2xx) will always be errors,
|
|
1503
|
+
// but a successful status code can still result in an error if the user
|
|
1504
|
+
// asked for JSON data and the body cannot be parsed as such.
|
|
1505
|
+
const ok = status >= 200 && status < 300;
|
|
1506
|
+
if (ok) {
|
|
1507
|
+
observer.next(new HttpResponse({
|
|
1508
|
+
body,
|
|
1509
|
+
headers,
|
|
1510
|
+
status,
|
|
1511
|
+
statusText,
|
|
1512
|
+
url,
|
|
1513
|
+
}));
|
|
1514
|
+
// The full body has been received and delivered, no further events
|
|
1515
|
+
// are possible. This request is complete.
|
|
1516
|
+
observer.complete();
|
|
1517
|
+
}
|
|
1518
|
+
else {
|
|
1519
|
+
observer.error(new HttpErrorResponse({
|
|
1520
|
+
error: body,
|
|
1521
|
+
headers,
|
|
1522
|
+
status,
|
|
1523
|
+
statusText,
|
|
1524
|
+
url,
|
|
1525
|
+
}));
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
parseBody(request, binContent) {
|
|
1529
|
+
switch (request.responseType) {
|
|
1530
|
+
case 'json':
|
|
1531
|
+
// stripping the XSSI when present
|
|
1532
|
+
const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, '');
|
|
1533
|
+
return text === '' ? null : JSON.parse(text);
|
|
1534
|
+
case 'text':
|
|
1535
|
+
return new TextDecoder().decode(binContent);
|
|
1536
|
+
case 'blob':
|
|
1537
|
+
return new Blob([binContent]);
|
|
1538
|
+
case 'arraybuffer':
|
|
1539
|
+
return binContent.buffer;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
createRequestInit(req) {
|
|
1543
|
+
// We could share some of this logic with the XhrBackend
|
|
1544
|
+
const headers = {};
|
|
1545
|
+
const credentials = req.withCredentials ? 'include' : undefined;
|
|
1546
|
+
// Setting all the requested headers.
|
|
1547
|
+
req.headers.forEach((name, values) => (headers[name] = values.join(',')));
|
|
1548
|
+
// Add an Accept header if one isn't present already.
|
|
1549
|
+
headers['Accept'] ??= 'application/json, text/plain, */*';
|
|
1550
|
+
// Auto-detect the Content-Type header if one isn't present already.
|
|
1551
|
+
if (!headers['Content-Type']) {
|
|
1552
|
+
const detectedType = req.detectContentTypeHeader();
|
|
1553
|
+
// Sometimes Content-Type detection fails.
|
|
1554
|
+
if (detectedType !== null) {
|
|
1555
|
+
headers['Content-Type'] = detectedType;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
return {
|
|
1559
|
+
body: req.body,
|
|
1560
|
+
method: req.method,
|
|
1561
|
+
headers,
|
|
1562
|
+
credentials,
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
concatChunks(chunks, totalLength) {
|
|
1566
|
+
const chunksAll = new Uint8Array(totalLength);
|
|
1567
|
+
let position = 0;
|
|
1568
|
+
for (const chunk of chunks) {
|
|
1569
|
+
chunksAll.set(chunk, position);
|
|
1570
|
+
position += chunk.length;
|
|
1571
|
+
}
|
|
1572
|
+
return chunksAll;
|
|
1573
|
+
}
|
|
1574
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1575
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: FetchBackend }); }
|
|
1576
|
+
}
|
|
1577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: FetchBackend, decorators: [{
|
|
1578
|
+
type: Injectable
|
|
1579
|
+
}] });
|
|
1580
|
+
/**
|
|
1581
|
+
* Abstract class to provide a mocked implementation of `fetch()`
|
|
1582
|
+
*/
|
|
1583
|
+
class FetchFactory {
|
|
1584
|
+
}
|
|
1585
|
+
function noop() { }
|
|
1586
|
+
/**
|
|
1587
|
+
* Zone.js treats a rejected promise that has not yet been awaited
|
|
1588
|
+
* as an unhandled error. This function adds a noop `.then` to make
|
|
1589
|
+
* sure that Zone.js doesn't throw an error if the Promise is rejected
|
|
1590
|
+
* synchronously.
|
|
1591
|
+
*/
|
|
1592
|
+
function silenceSuperfluousUnhandledPromiseRejection(promise) {
|
|
1593
|
+
promise.then(noop, noop);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1381
1596
|
function interceptorChainEndFn(req, finalHandlerFn) {
|
|
1382
1597
|
return finalHandlerFn(req);
|
|
1383
1598
|
}
|
|
@@ -1429,7 +1644,9 @@ function legacyInterceptorFnFactory() {
|
|
|
1429
1644
|
// out.
|
|
1430
1645
|
chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
|
|
1431
1646
|
}
|
|
1432
|
-
|
|
1647
|
+
const pendingTasks = inject(ɵInitialRenderPendingTasks);
|
|
1648
|
+
const taskId = pendingTasks.add();
|
|
1649
|
+
return chain(req, handler).pipe(finalize(() => pendingTasks.remove(taskId)));
|
|
1433
1650
|
};
|
|
1434
1651
|
}
|
|
1435
1652
|
class HttpInterceptorHandler extends HttpHandler {
|
|
@@ -1438,6 +1655,7 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1438
1655
|
this.backend = backend;
|
|
1439
1656
|
this.injector = injector;
|
|
1440
1657
|
this.chain = null;
|
|
1658
|
+
this.pendingTasks = inject(ɵInitialRenderPendingTasks);
|
|
1441
1659
|
}
|
|
1442
1660
|
handle(initialRequest) {
|
|
1443
1661
|
if (this.chain === null) {
|
|
@@ -1451,12 +1669,14 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1451
1669
|
// out.
|
|
1452
1670
|
this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
|
|
1453
1671
|
}
|
|
1454
|
-
|
|
1672
|
+
const taskId = this.pendingTasks.add();
|
|
1673
|
+
return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest))
|
|
1674
|
+
.pipe(finalize(() => this.pendingTasks.remove(taskId)));
|
|
1455
1675
|
}
|
|
1456
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
1457
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
1676
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1677
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler }); }
|
|
1458
1678
|
}
|
|
1459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
1679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1460
1680
|
type: Injectable
|
|
1461
1681
|
}], ctorParameters: function () { return [{ type: HttpBackend }, { type: i0.EnvironmentInjector }]; } });
|
|
1462
1682
|
|
|
@@ -1658,10 +1878,10 @@ class JsonpClientBackend {
|
|
|
1658
1878
|
}
|
|
1659
1879
|
foreignDocument.adoptNode(script);
|
|
1660
1880
|
}
|
|
1661
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
1662
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
1881
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1882
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpClientBackend }); }
|
|
1663
1883
|
}
|
|
1664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
1884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
1665
1885
|
type: Injectable
|
|
1666
1886
|
}], ctorParameters: function () { return [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
1667
1887
|
type: Inject,
|
|
@@ -1699,10 +1919,10 @@ class JsonpInterceptor {
|
|
|
1699
1919
|
intercept(initialRequest, next) {
|
|
1700
1920
|
return this.injector.runInContext(() => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
1701
1921
|
}
|
|
1702
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
1703
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
1922
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1923
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpInterceptor }); }
|
|
1704
1924
|
}
|
|
1705
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
1925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
1706
1926
|
type: Injectable
|
|
1707
1927
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
1708
1928
|
|
|
@@ -1743,9 +1963,6 @@ class HttpXhrBackend {
|
|
|
1743
1963
|
throw new ɵRuntimeError(-2800 /* RuntimeErrorCode.MISSING_JSONP_MODULE */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
1744
1964
|
`Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
|
|
1745
1965
|
}
|
|
1746
|
-
// Schedule a macrotask. This will cause NgZone.isStable to be set to false,
|
|
1747
|
-
// Which delays server rendering until the request is completed.
|
|
1748
|
-
const macroTaskCanceller = createBackgroundMacroTask();
|
|
1749
1966
|
// Check whether this factory has a special function to load an XHR implementation
|
|
1750
1967
|
// for various non-browser environments. We currently limit it to only `ServerXhr`
|
|
1751
1968
|
// class, which needs to load an XHR implementation.
|
|
@@ -1895,8 +2112,6 @@ class HttpXhrBackend {
|
|
|
1895
2112
|
url: url || undefined,
|
|
1896
2113
|
});
|
|
1897
2114
|
observer.error(res);
|
|
1898
|
-
// Cancel the background macrotask.
|
|
1899
|
-
macroTaskCanceller();
|
|
1900
2115
|
};
|
|
1901
2116
|
// The sentHeaders flag tracks whether the HttpResponseHeaders event
|
|
1902
2117
|
// has been sent on the stream. This is necessary to track if progress
|
|
@@ -1961,28 +2176,17 @@ class HttpXhrBackend {
|
|
|
1961
2176
|
xhr.upload.addEventListener('progress', onUpProgress);
|
|
1962
2177
|
}
|
|
1963
2178
|
}
|
|
1964
|
-
/** Tear down logic to cancel the backround macrotask. */
|
|
1965
|
-
const onLoadEnd = () => macroTaskCanceller();
|
|
1966
|
-
xhr.addEventListener('loadend', onLoadEnd);
|
|
1967
2179
|
// Fire the request, and notify the event stream that it was fired.
|
|
1968
|
-
|
|
1969
|
-
xhr.send(reqBody);
|
|
1970
|
-
}
|
|
1971
|
-
catch (e) {
|
|
1972
|
-
onError(e);
|
|
1973
|
-
}
|
|
2180
|
+
xhr.send(reqBody);
|
|
1974
2181
|
observer.next({ type: HttpEventType.Sent });
|
|
1975
2182
|
// This is the return from the Observable function, which is the
|
|
1976
2183
|
// request cancellation handler.
|
|
1977
2184
|
return () => {
|
|
1978
2185
|
// On a cancellation, remove all registered event listeners.
|
|
1979
|
-
xhr.removeEventListener('loadend', onLoadEnd);
|
|
1980
2186
|
xhr.removeEventListener('error', onError);
|
|
1981
2187
|
xhr.removeEventListener('abort', onError);
|
|
1982
2188
|
xhr.removeEventListener('load', onLoad);
|
|
1983
2189
|
xhr.removeEventListener('timeout', onError);
|
|
1984
|
-
// Cancel the background macrotask.
|
|
1985
|
-
macroTaskCanceller();
|
|
1986
2190
|
if (req.reportProgress) {
|
|
1987
2191
|
xhr.removeEventListener('progress', onDownProgress);
|
|
1988
2192
|
if (reqBody !== null && xhr.upload) {
|
|
@@ -1997,32 +2201,12 @@ class HttpXhrBackend {
|
|
|
1997
2201
|
});
|
|
1998
2202
|
}));
|
|
1999
2203
|
}
|
|
2000
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2001
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
2204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2205
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXhrBackend }); }
|
|
2002
2206
|
}
|
|
2003
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2004
2208
|
type: Injectable
|
|
2005
2209
|
}], ctorParameters: function () { return [{ type: i1.XhrFactory }]; } });
|
|
2006
|
-
/**
|
|
2007
|
-
* A method that creates a background macrotask using Zone.js.
|
|
2008
|
-
*
|
|
2009
|
-
* This is so that Zone.js can intercept HTTP calls, this is important for server rendering,
|
|
2010
|
-
* as the application is only rendered once the application is stabilized, meaning there are pending
|
|
2011
|
-
* macro and micro tasks.
|
|
2012
|
-
*
|
|
2013
|
-
* @returns a callback method to cancel the macrotask.
|
|
2014
|
-
*/
|
|
2015
|
-
function createBackgroundMacroTask() {
|
|
2016
|
-
// We use Zone.js when it's defined as otherwise a `setTimeout` will leave open timers which
|
|
2017
|
-
// causes `fakeAsync` tests to fail.
|
|
2018
|
-
const noop = () => { };
|
|
2019
|
-
if (typeof Zone !== 'undefined') {
|
|
2020
|
-
const zoneCurrent = Zone.current;
|
|
2021
|
-
const task = zoneCurrent.scheduleMacroTask('httpMacroTask', noop, undefined, noop, noop);
|
|
2022
|
-
return () => zoneCurrent.cancelTask(task);
|
|
2023
|
-
}
|
|
2024
|
-
return noop;
|
|
2025
|
-
}
|
|
2026
2210
|
|
|
2027
2211
|
const XSRF_ENABLED = new InjectionToken('XSRF_ENABLED');
|
|
2028
2212
|
const XSRF_DEFAULT_COOKIE_NAME = 'XSRF-TOKEN';
|
|
@@ -2069,10 +2253,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2069
2253
|
}
|
|
2070
2254
|
return this.lastToken;
|
|
2071
2255
|
}
|
|
2072
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2073
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
2256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2257
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor }); }
|
|
2074
2258
|
}
|
|
2075
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2076
2260
|
type: Injectable
|
|
2077
2261
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2078
2262
|
type: Inject,
|
|
@@ -2112,10 +2296,10 @@ class HttpXsrfInterceptor {
|
|
|
2112
2296
|
intercept(initialRequest, next) {
|
|
2113
2297
|
return this.injector.runInContext(() => xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
2114
2298
|
}
|
|
2115
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2116
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-
|
|
2299
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2300
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor }); }
|
|
2117
2301
|
}
|
|
2118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2119
2303
|
type: Injectable
|
|
2120
2304
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
2121
2305
|
|
|
@@ -2132,6 +2316,7 @@ var HttpFeatureKind;
|
|
|
2132
2316
|
HttpFeatureKind[HttpFeatureKind["NoXsrfProtection"] = 3] = "NoXsrfProtection";
|
|
2133
2317
|
HttpFeatureKind[HttpFeatureKind["JsonpSupport"] = 4] = "JsonpSupport";
|
|
2134
2318
|
HttpFeatureKind[HttpFeatureKind["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent";
|
|
2319
|
+
HttpFeatureKind[HttpFeatureKind["Fetch"] = 6] = "Fetch";
|
|
2135
2320
|
})(HttpFeatureKind || (HttpFeatureKind = {}));
|
|
2136
2321
|
function makeHttpFeature(kind, providers) {
|
|
2137
2322
|
return {
|
|
@@ -2153,6 +2338,7 @@ function makeHttpFeature(kind, providers) {
|
|
|
2153
2338
|
* @see {@link withNoXsrfProtection}
|
|
2154
2339
|
* @see {@link withJsonpSupport}
|
|
2155
2340
|
* @see {@link withRequestsMadeViaParent}
|
|
2341
|
+
* @see {@link withFetch}
|
|
2156
2342
|
*/
|
|
2157
2343
|
function provideHttpClient(...features) {
|
|
2158
2344
|
if (ngDevMode) {
|
|
@@ -2308,6 +2494,29 @@ function withRequestsMadeViaParent() {
|
|
|
2308
2494
|
},
|
|
2309
2495
|
]);
|
|
2310
2496
|
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Configures the current `HttpClient` instance to make requests using the fetch API.
|
|
2499
|
+
*
|
|
2500
|
+
* This `FetchBackend` requires the support of the Fetch API which is available on all evergreen
|
|
2501
|
+
* browsers and on NodeJS from v18 onward.
|
|
2502
|
+
*
|
|
2503
|
+
* Note: The Fetch API doesn't support progress report on uploads.
|
|
2504
|
+
*
|
|
2505
|
+
* @publicApi
|
|
2506
|
+
* @developerPreview
|
|
2507
|
+
*/
|
|
2508
|
+
function withFetch() {
|
|
2509
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof fetch !== 'function') {
|
|
2510
|
+
// TODO: Create a runtime error
|
|
2511
|
+
// TODO: Use ENVIRONMENT_INITIALIZER to contextualize the error message (browser or server)
|
|
2512
|
+
throw new Error('The `withFetch` feature of HttpClient requires the `fetch` API to be available. ' +
|
|
2513
|
+
'If you run the code in a Node environment, make sure you use Node v18.10 or later.');
|
|
2514
|
+
}
|
|
2515
|
+
return makeHttpFeature(HttpFeatureKind.Fetch, [
|
|
2516
|
+
FetchBackend,
|
|
2517
|
+
{ provide: HttpBackend, useExisting: FetchBackend },
|
|
2518
|
+
]);
|
|
2519
|
+
}
|
|
2311
2520
|
|
|
2312
2521
|
/**
|
|
2313
2522
|
* Configures XSRF protection support for outgoing requests.
|
|
@@ -2347,9 +2556,9 @@ class HttpClientXsrfModule {
|
|
|
2347
2556
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
2348
2557
|
};
|
|
2349
2558
|
}
|
|
2350
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2351
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-
|
|
2352
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-
|
|
2559
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2560
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule }); }
|
|
2561
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2353
2562
|
HttpXsrfInterceptor,
|
|
2354
2563
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2355
2564
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2360,7 +2569,7 @@ class HttpClientXsrfModule {
|
|
|
2360
2569
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2361
2570
|
] }); }
|
|
2362
2571
|
}
|
|
2363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2364
2573
|
type: NgModule,
|
|
2365
2574
|
args: [{
|
|
2366
2575
|
providers: [
|
|
@@ -2385,13 +2594,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2",
|
|
|
2385
2594
|
* @publicApi
|
|
2386
2595
|
*/
|
|
2387
2596
|
class HttpClientModule {
|
|
2388
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2389
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-
|
|
2390
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-
|
|
2597
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2598
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientModule }); }
|
|
2599
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientModule, providers: [
|
|
2391
2600
|
provideHttpClient(withInterceptorsFromDi()),
|
|
2392
2601
|
] }); }
|
|
2393
2602
|
}
|
|
2394
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2395
2604
|
type: NgModule,
|
|
2396
2605
|
args: [{
|
|
2397
2606
|
/**
|
|
@@ -2412,13 +2621,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-next.2",
|
|
|
2412
2621
|
* @publicApi
|
|
2413
2622
|
*/
|
|
2414
2623
|
class HttpClientJsonpModule {
|
|
2415
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-
|
|
2416
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-
|
|
2417
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-
|
|
2624
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2625
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule }); }
|
|
2626
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, providers: [
|
|
2418
2627
|
withJsonpSupport().ɵproviders,
|
|
2419
2628
|
] }); }
|
|
2420
2629
|
}
|
|
2421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-
|
|
2630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2422
2631
|
type: NgModule,
|
|
2423
2632
|
args: [{
|
|
2424
2633
|
providers: [
|
|
@@ -2543,15 +2752,12 @@ function withHttpTransferCache() {
|
|
|
2543
2752
|
useFactory: () => {
|
|
2544
2753
|
const appRef = inject(ApplicationRef);
|
|
2545
2754
|
const cacheState = inject(CACHE_STATE);
|
|
2546
|
-
const pendingTasks = inject(ɵInitialRenderPendingTasks);
|
|
2547
2755
|
return () => {
|
|
2548
|
-
|
|
2549
|
-
isStablePromise.then(() => pendingTasks.whenAllTasksComplete).then(() => {
|
|
2756
|
+
appRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => {
|
|
2550
2757
|
cacheState.isCacheActive = false;
|
|
2551
2758
|
});
|
|
2552
2759
|
};
|
|
2553
|
-
}
|
|
2554
|
-
deps: [ApplicationRef, CACHE_STATE, ɵInitialRenderPendingTasks]
|
|
2760
|
+
}
|
|
2555
2761
|
}
|
|
2556
2762
|
];
|
|
2557
2763
|
}
|
|
@@ -2562,5 +2768,5 @@ function withHttpTransferCache() {
|
|
|
2562
2768
|
* Generated bundle index. Do not edit.
|
|
2563
2769
|
*/
|
|
2564
2770
|
|
|
2565
|
-
export { HTTP_INTERCEPTORS, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, withHttpTransferCache as ɵwithHttpTransferCache };
|
|
2771
|
+
export { FetchBackend, HTTP_INTERCEPTORS, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, withHttpTransferCache as ɵwithHttpTransferCache };
|
|
2566
2772
|
//# sourceMappingURL=http.mjs.map
|