@angular/common 21.0.0-next.1 → 21.0.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.1
2
+ * @license Angular v21.0.0-next.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1131,6 +1131,20 @@ class HttpResponseBase {
1131
1131
  * When using the default XHR Request this property will be `undefined`
1132
1132
  */
1133
1133
  redirected;
1134
+ /**
1135
+ * Indicates the type of the HTTP response, based on how the request was made and how the browser handles the response.
1136
+ *
1137
+ * This corresponds to the `type` property of the Fetch API's `Response` object, which can indicate values such as:
1138
+ * - `'basic'`: A same-origin response, allowing full access to the body and headers.
1139
+ * - `'cors'`: A cross-origin response with CORS enabled, exposing only safe response headers.
1140
+ * - `'opaque'`: A cross-origin response made with `no-cors`, where the response body and headers are inaccessible.
1141
+ * - `'opaqueredirect'`: A response resulting from a redirect followed in `no-cors` mode.
1142
+ * - `'error'`: A response representing a network error or similar failure.
1143
+ *
1144
+ * This property is only available when using the Fetch-based backend (via `withFetch()`).
1145
+ * When using Angular's (XHR) backend, this value will be `undefined`.
1146
+ */
1147
+ responseType;
1134
1148
  /**
1135
1149
  * Super-constructor for all responses.
1136
1150
  *
@@ -1145,6 +1159,7 @@ class HttpResponseBase {
1145
1159
  this.statusText = init.statusText || defaultStatusText;
1146
1160
  this.url = init.url || null;
1147
1161
  this.redirected = init.redirected;
1162
+ this.responseType = init.responseType;
1148
1163
  // Cache the ok value to avoid defining a getter.
1149
1164
  this.ok = this.status >= 200 && this.status < 300;
1150
1165
  }
@@ -1211,6 +1226,7 @@ class HttpResponse extends HttpResponseBase {
1211
1226
  statusText: update.statusText || this.statusText,
1212
1227
  url: update.url || this.url || undefined,
1213
1228
  redirected: update.redirected ?? this.redirected,
1229
+ responseType: update.responseType ?? this.responseType,
1214
1230
  });
1215
1231
  }
1216
1232
  }
@@ -1502,6 +1518,7 @@ class FetchBackend {
1502
1518
  // asked for JSON data and the body cannot be parsed as such.
1503
1519
  const ok = status >= 200 && status < 300;
1504
1520
  const redirected = response.redirected;
1521
+ const responseType = response.type;
1505
1522
  if (ok) {
1506
1523
  observer.next(new HttpResponse({
1507
1524
  body,
@@ -1510,6 +1527,7 @@ class FetchBackend {
1510
1527
  statusText,
1511
1528
  url,
1512
1529
  redirected,
1530
+ responseType,
1513
1531
  }));
1514
1532
  // The full body has been received and delivered, no further events
1515
1533
  // are possible. This request is complete.
@@ -1523,6 +1541,7 @@ class FetchBackend {
1523
1541
  statusText,
1524
1542
  url,
1525
1543
  redirected,
1544
+ responseType,
1526
1545
  }));
1527
1546
  }
1528
1547
  }