Skip to content

Commit a0ef7d4

Browse files
committed
fix(???): 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 5dd4043 commit a0ef7d4

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

src/material-experimental/mdc-chips/module.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
import {ENTER} from '@angular/cdk/keycodes';
1010
import {CommonModule} from '@angular/common';
1111
import {NgModule} from '@angular/core';
12-
import {
13-
ErrorStateMatcher,
14-
MatCommonModule,
15-
MatRippleModule,
16-
} from '@angular/material-experimental/mdc-core';
12+
import {MatCommonModule, MatRippleModule} from '@angular/material/core';
1713
import {MatChip, MatChipCssInternalOnly} from './chip';
1814
import {MAT_CHIPS_DEFAULT_OPTIONS, MatChipsDefaultOptions} from './chip-default-options';
1915
import {MatChipEditInput} from './chip-edit-input';
@@ -45,7 +41,6 @@ const CHIP_DECLARATIONS = [
4541
exports: [MatCommonModule, CHIP_DECLARATIONS],
4642
declarations: CHIP_DECLARATIONS,
4743
providers: [
48-
ErrorStateMatcher,
4944
{
5045
provide: MAT_CHIPS_DEFAULT_OPTIONS,
5146
useValue: {

src/material/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 {MatChip, MatChipAvatar, MatChipRemove, MatChipTrailingIcon} from './chip';
1313
import {MAT_CHIPS_DEFAULT_OPTIONS, MatChipsDefaultOptions} from './chip-default-options';
1414
import {MatChipInput} from './chip-input';
@@ -28,7 +28,6 @@ const CHIP_DECLARATIONS = [
2828
exports: CHIP_DECLARATIONS,
2929
declarations: CHIP_DECLARATIONS,
3030
providers: [
31-
ErrorStateMatcher,
3231
{
3332
provide: MAT_CHIPS_DEFAULT_OPTIONS,
3433
useValue: {

src/material/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 {MatFormFieldModule} from '@angular/material/form-field';
1313
import {MatInput} from './input';
1414

@@ -22,6 +22,5 @@ import {MatInput} from './input';
2222
MatFormFieldModule,
2323
MatInput,
2424
],
25-
providers: [ErrorStateMatcher],
2625
})
2726
export class MatInputModule {}

src/material/stepper/stepper-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {CdkStepperModule} from '@angular/cdk/stepper';
1111
import {CommonModule} from '@angular/common';
1212
import {NgModule} from '@angular/core';
1313
import {MatButtonModule} from '@angular/material/button';
14-
import {ErrorStateMatcher, MatCommonModule, MatRippleModule} from '@angular/material/core';
14+
import {MatCommonModule, MatRippleModule} from '@angular/material/core';
1515
import {MatIconModule} from '@angular/material/icon';
1616
import {MatStepHeader} from './step-header';
1717
import {MatStepLabel} from './step-label';
@@ -54,6 +54,6 @@ import {MatStepContent} from './step-content';
5454
MatStepperIcon,
5555
MatStepContent,
5656
],
57-
providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher],
57+
providers: [MAT_STEPPER_INTL_PROVIDER],
5858
})
5959
export class MatStepperModule {}

0 commit comments

Comments
 (0)