Skip to content

Commit daaa69c

Browse files
authored
build: remove provideHttpClient (#32109)
`provideHttpClient` shouldn't be necessary anymore since the client is `providedIn: 'root'`.
1 parent 8f7292f commit daaa69c

File tree

5 files changed

+2
-16
lines changed

5 files changed

+2
-16
lines changed

docs/src/app/pages/guide-viewer/guide-viewer.spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {Observable} from 'rxjs';
33
import {ActivatedRoute, provideRouter} from '@angular/router';
44
import {GuideViewer} from './guide-viewer';
5-
import {provideHttpClient} from '@angular/common/http';
65

76
const guideItemsId = 'getting-started';
87

@@ -21,11 +20,7 @@ describe('GuideViewer', () => {
2120

2221
beforeEach(() => {
2322
TestBed.configureTestingModule({
24-
providers: [
25-
provideRouter([]),
26-
{provide: ActivatedRoute, useValue: mockActivatedRoute},
27-
provideHttpClient(),
28-
],
23+
providers: [provideRouter([]), {provide: ActivatedRoute, useValue: mockActivatedRoute}],
2924
});
3025
});
3126

docs/src/app/shared/doc-viewer/doc-viewer.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Clipboard} from '@angular/cdk/clipboard';
2-
import {provideHttpClient} from '@angular/common/http';
32
import {HttpTestingController, provideHttpClientTesting} from '@angular/common/http/testing';
43
import {Component, provideZoneChangeDetection} from '@angular/core';
54
import {TestBed} from '@angular/core/testing';
@@ -20,7 +19,6 @@ describe('DocViewer', () => {
2019
providers: [
2120
{provide: Clipboard, useValue: clipboardSpy},
2221
provideRouter([]),
23-
provideHttpClient(),
2422
provideHttpClientTesting(),
2523
provideZoneChangeDetection(),
2624
],

docs/src/assets/stackblitz/src/main.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
*/
88

99
import {bootstrapApplication} from '@angular/platform-browser';
10-
import {provideHttpClient} from '@angular/common/http';
1110
import {VERSION as CDK_VERSION} from '@angular/cdk';
1211
import {VERSION as MAT_VERSION} from '@angular/material/core';
1312
import {MaterialDocsExample} from './example/material-docs-example';
1413

1514
console.info('Angular CDK version', CDK_VERSION.full);
1615
console.info('Angular Material version', MAT_VERSION.full);
1716

18-
bootstrapApplication(MaterialDocsExample, {
19-
providers: [provideHttpClient()],
20-
}).catch(err => console.error(err));
17+
bootstrapApplication(MaterialDocsExample).catch(err => console.error(err));

docs/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {provideHttpClient} from '@angular/common/http';
109
import {ErrorHandler, provideZoneChangeDetection} from '@angular/core';
1110

1211
import {LocationStrategy, PathLocationStrategy} from '@angular/common';
@@ -32,7 +31,6 @@ bootstrapApplication(MaterialDocsApp, {
3231
anchorScrolling: 'enabled',
3332
}),
3433
),
35-
provideHttpClient(),
3634
provideZoneChangeDetection(),
3735
],
3836
}).catch(err => console.error(err));

src/dev-app/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// Load `$localize` for examples using it.
1010
import '@angular/localize/init';
1111

12-
import {provideHttpClient} from '@angular/common/http';
1312
import {
1413
provideZonelessChangeDetection,
1514
// tslint:disable-next-line:no-zone-dependencies -- Allow manual testing of dev-app with zones
@@ -51,7 +50,6 @@ function bootstrap(): void {
5150
providers: [
5251
provideRouter(DEV_APP_ROUTES),
5352
provideNativeDateAdapter(),
54-
provideHttpClient(),
5553
{
5654
provide: MATERIAL_ANIMATIONS,
5755
useValue: {

0 commit comments

Comments
 (0)