Skip to content

Commit 4d48433

Browse files
committed
fix(material/core): make ErrorStateMatcher tree-shakable
In order to be tree-shakable, services must be marked as `providedIn` and they must not be explicitly referenced in the `providers` of an `NgModule`.
1 parent e32fe78 commit 4d48433

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/material/chips/module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import {ENTER} from '@angular/cdk/keycodes';
1010
import {CommonModule} from '@angular/common';
1111
import {NgModule} from '@angular/core';
12-
import {ErrorStateMatcher, MatCommonModule, MatRippleModule} from '@angular/material/core';
12+
import {MatCommonModule, MatRippleModule} from '@angular/material/core';
1313
import {MatChip} from './chip';
1414
import {MAT_CHIPS_DEFAULT_OPTIONS, MatChipsDefaultOptions} from './tokens';
1515
import {MatChipEditInput} from './chip-edit-input';
@@ -41,7 +41,6 @@ const CHIP_DECLARATIONS = [
4141
exports: [MatCommonModule, CHIP_DECLARATIONS],
4242
declarations: [MatChipAction, CHIP_DECLARATIONS],
4343
providers: [
44-
ErrorStateMatcher,
4544
{
4645
provide: MAT_CHIPS_DEFAULT_OPTIONS,
4746
useValue: {

src/material/legacy-chips/chips-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {ENTER} from '@angular/cdk/keycodes';
1010
import {NgModule} from '@angular/core';
11-
import {ErrorStateMatcher, MatCommonModule} from '@angular/material/core';
11+
import {MatCommonModule} from '@angular/material/core';
1212
import {
1313
MatLegacyChip,
1414
MatLegacyChipAvatar,
@@ -40,7 +40,6 @@ const CHIP_DECLARATIONS = [
4040
exports: CHIP_DECLARATIONS,
4141
declarations: CHIP_DECLARATIONS,
4242
providers: [
43-
ErrorStateMatcher,
4443
{
4544
provide: MAT_LEGACY_CHIPS_DEFAULT_OPTIONS,
4645
useValue: {

src/material/legacy-input/input-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {TextFieldModule} from '@angular/cdk/text-field';
1010
import {NgModule} from '@angular/core';
11-
import {ErrorStateMatcher, MatCommonModule} from '@angular/material/core';
11+
import {MatCommonModule} from '@angular/material/core';
1212
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
1313
import {MatLegacyInput} from './input';
1414

@@ -26,6 +26,5 @@ import {MatLegacyInput} from './input';
2626
MatLegacyFormFieldModule,
2727
MatLegacyInput,
2828
],
29-
providers: [ErrorStateMatcher],
3029
})
3130
export class MatLegacyInputModule {}

src/material/stepper/stepper-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {PortalModule} from '@angular/cdk/portal';
1010
import {CdkStepperModule} from '@angular/cdk/stepper';
1111
import {CommonModule} from '@angular/common';
1212
import {NgModule} from '@angular/core';
13-
import {ErrorStateMatcher, MatCommonModule, MatRippleModule} from '@angular/material/core';
13+
import {MatCommonModule, MatRippleModule} from '@angular/material/core';
1414
import {MatIconModule} from '@angular/material/icon';
1515
import {MatStepHeader} from './step-header';
1616
import {MatStepLabel} from './step-label';
@@ -50,6 +50,6 @@ import {MatStepContent} from './step-content';
5050
MatStepperIcon,
5151
MatStepContent,
5252
],
53-
providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher],
53+
providers: [MAT_STEPPER_INTL_PROVIDER],
5454
})
5555
export class MatStepperModule {}

0 commit comments

Comments
 (0)