@angular/common 15.0.0-rc.2 → 15.0.0-rc.4
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/esm2020/http/public_api.mjs +2 -2
- package/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +4 -4
- package/esm2020/http/src/jsonp.mjs +6 -6
- package/esm2020/http/src/module.mjs +16 -16
- package/esm2020/http/src/provider.mjs +77 -2
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +6 -6
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +4 -4
- package/esm2020/src/common.mjs +2 -2
- package/esm2020/src/common_module.mjs +4 -4
- package/esm2020/src/directives/ng_class.mjs +3 -3
- package/esm2020/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2020/src/directives/ng_for_of.mjs +3 -3
- package/esm2020/src/directives/ng_if.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/index.mjs +2 -2
- package/esm2020/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/ng_optimized_image.mjs +45 -8
- package/esm2020/src/directives/ng_optimized_image/preconnect_link_checker.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/preload-link-creator.mjs +5 -4
- package/esm2020/src/directives/ng_plural.mjs +6 -6
- package/esm2020/src/directives/ng_style.mjs +3 -3
- package/esm2020/src/directives/ng_switch.mjs +9 -9
- package/esm2020/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2020/src/i18n/localization.mjs +6 -6
- package/esm2020/src/location/hash_location_strategy.mjs +3 -3
- package/esm2020/src/location/location.mjs +3 -3
- package/esm2020/src/location/location_strategy.mjs +6 -6
- package/esm2020/src/location/platform_location.mjs +6 -6
- package/esm2020/src/pipes/async_pipe.mjs +3 -3
- package/esm2020/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2020/src/pipes/date_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/json_pipe.mjs +3 -3
- package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2020/src/pipes/number_pipe.mjs +9 -9
- package/esm2020/src/pipes/slice_pipe.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/location_mock.mjs +3 -3
- package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2020/testing/src/mock_platform_location.mjs +3 -3
- package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2015/common.mjs +157 -119
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +8 -8
- package/fesm2015/http.mjs +113 -38
- package/fesm2015/http.mjs.map +1 -1
- package/fesm2015/testing.mjs +10 -10
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2020/common.mjs +157 -119
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +8 -8
- package/fesm2020/http.mjs +113 -38
- package/fesm2020/http.mjs.map +1 -1
- package/fesm2020/testing.mjs +10 -10
- package/fesm2020/upgrade.mjs +5 -5
- package/http/index.d.ts +87 -3
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +24 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-rc.
|
|
2
|
+
* @license Angular v15.0.0-rc.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -330,9 +330,9 @@ class HttpClientTestingBackend {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
HttpClientTestingBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
334
|
-
HttpClientTestingBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
335
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
333
|
+
HttpClientTestingBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
+
HttpClientTestingBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingBackend });
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
|
|
336
336
|
type: Injectable
|
|
337
337
|
}] });
|
|
338
338
|
function describeRequest(testRequest) {
|
|
@@ -372,12 +372,12 @@ function provideHttpClientTesting() {
|
|
|
372
372
|
*/
|
|
373
373
|
class HttpClientTestingModule {
|
|
374
374
|
}
|
|
375
|
-
HttpClientTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
376
|
-
HttpClientTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
377
|
-
HttpClientTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
375
|
+
HttpClientTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
376
|
+
HttpClientTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
|
|
377
|
+
HttpClientTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingModule, providers: [
|
|
378
378
|
provideHttpClientTesting(),
|
|
379
379
|
], imports: [HttpClientModule] });
|
|
380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientTestingModule, decorators: [{
|
|
381
381
|
type: NgModule,
|
|
382
382
|
args: [{
|
|
383
383
|
imports: [
|
package/fesm2020/http.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-rc.
|
|
2
|
+
* @license Angular v15.0.0-rc.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1415,9 +1415,9 @@ class HttpClient {
|
|
|
1415
1415
|
return this.request('PUT', url, addBody(options, body));
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
HttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1419
|
-
HttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1418
|
+
HttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1419
|
+
HttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClient });
|
|
1420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClient, decorators: [{
|
|
1421
1421
|
type: Injectable
|
|
1422
1422
|
}], ctorParameters: function () { return [{ type: HttpHandler }]; } });
|
|
1423
1423
|
|
|
@@ -1497,9 +1497,9 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1497
1497
|
return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest));
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
|
-
HttpInterceptorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1501
|
-
HttpInterceptorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1502
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1500
|
+
HttpInterceptorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1501
|
+
HttpInterceptorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpInterceptorHandler });
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1503
1503
|
type: Injectable
|
|
1504
1504
|
}], ctorParameters: function () { return [{ type: HttpBackend }, { type: i0.EnvironmentInjector }]; } });
|
|
1505
1505
|
|
|
@@ -1709,9 +1709,9 @@ class JsonpClientBackend {
|
|
|
1709
1709
|
foreignDocument.adoptNode(script);
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
|
-
JsonpClientBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1713
|
-
JsonpClientBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1714
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1712
|
+
JsonpClientBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1713
|
+
JsonpClientBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpClientBackend });
|
|
1714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
1715
1715
|
type: Injectable
|
|
1716
1716
|
}], ctorParameters: function () { return [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
1717
1717
|
type: Inject,
|
|
@@ -1750,9 +1750,9 @@ class JsonpInterceptor {
|
|
|
1750
1750
|
return this.injector.runInContext(() => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
|
-
JsonpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1754
|
-
JsonpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1753
|
+
JsonpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1754
|
+
JsonpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpInterceptor });
|
|
1755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
1756
1756
|
type: Injectable
|
|
1757
1757
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
1758
1758
|
|
|
@@ -2028,9 +2028,9 @@ class HttpXhrBackend {
|
|
|
2028
2028
|
});
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
|
-
HttpXhrBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2032
|
-
HttpXhrBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2033
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2031
|
+
HttpXhrBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2032
|
+
HttpXhrBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXhrBackend });
|
|
2033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2034
2034
|
type: Injectable
|
|
2035
2035
|
}], ctorParameters: function () { return [{ type: i1.XhrFactory }]; } });
|
|
2036
2036
|
|
|
@@ -2087,9 +2087,9 @@ class HttpXsrfCookieExtractor {
|
|
|
2087
2087
|
return this.lastToken;
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
-
HttpXsrfCookieExtractor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2091
|
-
HttpXsrfCookieExtractor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2092
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2090
|
+
HttpXsrfCookieExtractor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2091
|
+
HttpXsrfCookieExtractor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfCookieExtractor });
|
|
2092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2093
2093
|
type: Injectable
|
|
2094
2094
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2095
2095
|
type: Inject,
|
|
@@ -2130,9 +2130,9 @@ class HttpXsrfInterceptor {
|
|
|
2130
2130
|
return this.injector.runInContext(() => xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
|
|
2131
2131
|
}
|
|
2132
2132
|
}
|
|
2133
|
-
HttpXsrfInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2134
|
-
HttpXsrfInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2133
|
+
HttpXsrfInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2134
|
+
HttpXsrfInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfInterceptor });
|
|
2135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2136
2136
|
type: Injectable
|
|
2137
2137
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
2138
2138
|
|
|
@@ -2143,6 +2143,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.2", ng
|
|
|
2143
2143
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2144
2144
|
* found in the LICENSE file at https://angular.io/license
|
|
2145
2145
|
*/
|
|
2146
|
+
/**
|
|
2147
|
+
* Identifies a particular kind of `HttpFeature`.
|
|
2148
|
+
*
|
|
2149
|
+
* @publicApi
|
|
2150
|
+
*/
|
|
2146
2151
|
var HttpFeatureKind;
|
|
2147
2152
|
(function (HttpFeatureKind) {
|
|
2148
2153
|
HttpFeatureKind[HttpFeatureKind["Interceptors"] = 0] = "Interceptors";
|
|
@@ -2158,6 +2163,21 @@ function makeHttpFeature(kind, providers) {
|
|
|
2158
2163
|
ɵproviders: providers,
|
|
2159
2164
|
};
|
|
2160
2165
|
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Configures Angular's `HttpClient` service to be available for injection.
|
|
2168
|
+
*
|
|
2169
|
+
* By default, `HttpClient` will be configured for injection with its default options for XSRF
|
|
2170
|
+
* protection of outgoing requests. Additional configuration options can be provided by passing
|
|
2171
|
+
* feature functions to `provideHttpClient`. For example, HTTP interceptors can be added using the
|
|
2172
|
+
* `withInterceptors(...)` feature.
|
|
2173
|
+
*
|
|
2174
|
+
* @see withInterceptors
|
|
2175
|
+
* @see withInterceptorsFromDi
|
|
2176
|
+
* @see withXsrfConfiguration
|
|
2177
|
+
* @see withNoXsrfProtection
|
|
2178
|
+
* @see withJsonpSupport
|
|
2179
|
+
* @see withRequestsMadeViaParent
|
|
2180
|
+
*/
|
|
2161
2181
|
function provideHttpClient(...features) {
|
|
2162
2182
|
if (ngDevMode) {
|
|
2163
2183
|
const featureKinds = new Set(features.map(f => f.ɵkind));
|
|
@@ -2187,6 +2207,14 @@ function provideHttpClient(...features) {
|
|
|
2187
2207
|
}
|
|
2188
2208
|
return makeEnvironmentProviders(providers);
|
|
2189
2209
|
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Adds one or more functional-style HTTP interceptors to the configuration of the `HttpClient`
|
|
2212
|
+
* instance.
|
|
2213
|
+
*
|
|
2214
|
+
* @see HttpInterceptorFn
|
|
2215
|
+
* @see provideHttpClient
|
|
2216
|
+
* @publicApi
|
|
2217
|
+
*/
|
|
2190
2218
|
function withInterceptors(interceptorFns) {
|
|
2191
2219
|
return makeHttpFeature(HttpFeatureKind.Interceptors, interceptorFns.map(interceptorFn => {
|
|
2192
2220
|
return {
|
|
@@ -2197,7 +2225,18 @@ function withInterceptors(interceptorFns) {
|
|
|
2197
2225
|
}));
|
|
2198
2226
|
}
|
|
2199
2227
|
const LEGACY_INTERCEPTOR_FN = new InjectionToken('LEGACY_INTERCEPTOR_FN');
|
|
2200
|
-
|
|
2228
|
+
/**
|
|
2229
|
+
* Includes class-based interceptors configured using a multi-provider in the current injector into
|
|
2230
|
+
* the configured `HttpClient` instance.
|
|
2231
|
+
*
|
|
2232
|
+
* Prefer `withInterceptors` and functional interceptors instead, as support for DI-provided
|
|
2233
|
+
* interceptors may be phased out in a later release.
|
|
2234
|
+
*
|
|
2235
|
+
* @see HttpInterceptor
|
|
2236
|
+
* @see HTTP_INTERCEPTORS
|
|
2237
|
+
* @see provideHttpClient
|
|
2238
|
+
*/
|
|
2239
|
+
function withInterceptorsFromDi() {
|
|
2201
2240
|
// Note: the legacy interceptor function is provided here via an intermediate token
|
|
2202
2241
|
// (`LEGACY_INTERCEPTOR_FN`), using a pattern which guarantees that if these providers are
|
|
2203
2242
|
// included multiple times, all of the multi-provider entries will have the same instance of the
|
|
@@ -2215,6 +2254,13 @@ function withLegacyInterceptors() {
|
|
|
2215
2254
|
}
|
|
2216
2255
|
]);
|
|
2217
2256
|
}
|
|
2257
|
+
/**
|
|
2258
|
+
* Customizes the XSRF protection for the configuration of the current `HttpClient` instance.
|
|
2259
|
+
*
|
|
2260
|
+
* This feature is incompatible with the `withNoXsrfProtection` feature.
|
|
2261
|
+
*
|
|
2262
|
+
* @see provideHttpClient
|
|
2263
|
+
*/
|
|
2218
2264
|
function withXsrfConfiguration({ cookieName, headerName }) {
|
|
2219
2265
|
const providers = [];
|
|
2220
2266
|
if (cookieName !== undefined) {
|
|
@@ -2225,6 +2271,13 @@ function withXsrfConfiguration({ cookieName, headerName }) {
|
|
|
2225
2271
|
}
|
|
2226
2272
|
return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
|
|
2227
2273
|
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Disables XSRF protection in the configuration of the current `HttpClient` instance.
|
|
2276
|
+
*
|
|
2277
|
+
* This feature is incompatible with the `withXsrfConfiguration` feature.
|
|
2278
|
+
*
|
|
2279
|
+
* @see provideHttpClient
|
|
2280
|
+
*/
|
|
2228
2281
|
function withNoXsrfProtection() {
|
|
2229
2282
|
return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [
|
|
2230
2283
|
{
|
|
@@ -2233,6 +2286,11 @@ function withNoXsrfProtection() {
|
|
|
2233
2286
|
},
|
|
2234
2287
|
]);
|
|
2235
2288
|
}
|
|
2289
|
+
/**
|
|
2290
|
+
* Add JSONP support to the configuration of the current `HttpClient` instance.
|
|
2291
|
+
*
|
|
2292
|
+
* @see provideHttpClient
|
|
2293
|
+
*/
|
|
2236
2294
|
function withJsonpSupport() {
|
|
2237
2295
|
return makeHttpFeature(HttpFeatureKind.JsonpSupport, [
|
|
2238
2296
|
JsonpClientBackend,
|
|
@@ -2241,6 +2299,23 @@ function withJsonpSupport() {
|
|
|
2241
2299
|
]);
|
|
2242
2300
|
}
|
|
2243
2301
|
/**
|
|
2302
|
+
* Configures the current `HttpClient` instance to make requests via the parent injector's
|
|
2303
|
+
* `HttpClient` instead of directly.
|
|
2304
|
+
*
|
|
2305
|
+
* By default, `provideHttpClient` configures `HttpClient` in its injector to be an independent
|
|
2306
|
+
* instance. For example, even if `HttpClient` is configured in the parent injector with
|
|
2307
|
+
* one or more interceptors, they will not intercept requests made via this instance.
|
|
2308
|
+
*
|
|
2309
|
+
* With this option enabled, once the request has passed through the current injector's
|
|
2310
|
+
* interceptors, it will be delegated to the parent injector's `HttpClient` chain instead of
|
|
2311
|
+
* dispatched directly, and interceptors in the parent configuration will be applied to the request.
|
|
2312
|
+
*
|
|
2313
|
+
* If there are several `HttpClient` instances in the injector hierarchy, it's possible for
|
|
2314
|
+
* `withRequestsMadeViaParent` to be used at multiple levels, which will cause the request to
|
|
2315
|
+
* "bubble up" until either reaching the root level or an `HttpClient` which was not configured with
|
|
2316
|
+
* this option.
|
|
2317
|
+
*
|
|
2318
|
+
* @see provideHttpClient
|
|
2244
2319
|
* @developerPreview
|
|
2245
2320
|
*/
|
|
2246
2321
|
function withRequestsMadeViaParent() {
|
|
@@ -2304,9 +2379,9 @@ class HttpClientXsrfModule {
|
|
|
2304
2379
|
};
|
|
2305
2380
|
}
|
|
2306
2381
|
}
|
|
2307
|
-
HttpClientXsrfModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2308
|
-
HttpClientXsrfModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2309
|
-
HttpClientXsrfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2382
|
+
HttpClientXsrfModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2383
|
+
HttpClientXsrfModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientXsrfModule });
|
|
2384
|
+
HttpClientXsrfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2310
2385
|
HttpXsrfInterceptor,
|
|
2311
2386
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2312
2387
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2316,7 +2391,7 @@ HttpClientXsrfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
2316
2391
|
}).ɵproviders,
|
|
2317
2392
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2318
2393
|
] });
|
|
2319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2320
2395
|
type: NgModule,
|
|
2321
2396
|
args: [{
|
|
2322
2397
|
providers: [
|
|
@@ -2342,15 +2417,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.2", ng
|
|
|
2342
2417
|
*/
|
|
2343
2418
|
class HttpClientModule {
|
|
2344
2419
|
}
|
|
2345
|
-
HttpClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2346
|
-
HttpClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2347
|
-
HttpClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2348
|
-
provideHttpClient(
|
|
2420
|
+
HttpClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2421
|
+
HttpClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientModule });
|
|
2422
|
+
HttpClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientModule, providers: [
|
|
2423
|
+
provideHttpClient(withInterceptorsFromDi(), withXsrfConfiguration({
|
|
2349
2424
|
cookieName: XSRF_DEFAULT_COOKIE_NAME,
|
|
2350
2425
|
headerName: XSRF_DEFAULT_HEADER_NAME,
|
|
2351
2426
|
})),
|
|
2352
2427
|
] });
|
|
2353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2354
2429
|
type: NgModule,
|
|
2355
2430
|
args: [{
|
|
2356
2431
|
/**
|
|
@@ -2358,7 +2433,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.2", ng
|
|
|
2358
2433
|
* with supporting services for HTTP communications.
|
|
2359
2434
|
*/
|
|
2360
2435
|
providers: [
|
|
2361
|
-
provideHttpClient(
|
|
2436
|
+
provideHttpClient(withInterceptorsFromDi(), withXsrfConfiguration({
|
|
2362
2437
|
cookieName: XSRF_DEFAULT_COOKIE_NAME,
|
|
2363
2438
|
headerName: XSRF_DEFAULT_HEADER_NAME,
|
|
2364
2439
|
})),
|
|
@@ -2375,12 +2450,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.2", ng
|
|
|
2375
2450
|
*/
|
|
2376
2451
|
class HttpClientJsonpModule {
|
|
2377
2452
|
}
|
|
2378
|
-
HttpClientJsonpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2379
|
-
HttpClientJsonpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2380
|
-
HttpClientJsonpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2453
|
+
HttpClientJsonpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2454
|
+
HttpClientJsonpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientJsonpModule });
|
|
2455
|
+
HttpClientJsonpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientJsonpModule, providers: [
|
|
2381
2456
|
withJsonpSupport().ɵproviders,
|
|
2382
2457
|
] });
|
|
2383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2384
2459
|
type: NgModule,
|
|
2385
2460
|
args: [{
|
|
2386
2461
|
providers: [
|
|
@@ -2418,5 +2493,5 @@ const XhrFactory = XhrFactory$1;
|
|
|
2418
2493
|
* Generated bundle index. Do not edit.
|
|
2419
2494
|
*/
|
|
2420
2495
|
|
|
2421
|
-
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, XhrFactory, provideHttpClient, withInterceptors,
|
|
2496
|
+
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, XhrFactory, provideHttpClient, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler };
|
|
2422
2497
|
//# sourceMappingURL=http.mjs.map
|