Skip to content

Commit bd48f39

Browse files
jelbournmmalerba
authored andcommitted
chore: add MdCommonModule for all components (#4208)
I will move the run-time sanity checks from CompatibilityModule to here once #4178 is merged.
1 parent cb98270 commit bd48f39

File tree

25 files changed

+87
-69
lines changed

25 files changed

+87
-69
lines changed

src/lib/autocomplete/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {ModuleWithProviders, NgModule} from '@angular/core';
22

3-
import {MdOptionModule, OverlayModule, OVERLAY_PROVIDERS, CompatibilityModule} from '../core';
3+
import {MdOptionModule, OverlayModule, OVERLAY_PROVIDERS, MdCommonModule} from '../core';
44
import {CommonModule} from '@angular/common';
55
import {MdAutocomplete} from './autocomplete';
66
import {MdAutocompleteTrigger} from './autocomplete-trigger';
77

88
@NgModule({
9-
imports: [MdOptionModule, OverlayModule, CompatibilityModule, CommonModule],
10-
exports: [MdAutocomplete, MdOptionModule, MdAutocompleteTrigger, CompatibilityModule],
9+
imports: [MdOptionModule, OverlayModule, MdCommonModule, CommonModule],
10+
exports: [MdAutocomplete, MdOptionModule, MdAutocompleteTrigger, MdCommonModule],
1111
declarations: [MdAutocomplete, MdAutocompleteTrigger],
1212
})
1313
export class MdAutocompleteModule {

src/lib/button-toggle/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import {FormsModule} from '@angular/forms';
33
import {MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle} from './button-toggle';
44
import {
55
UNIQUE_SELECTION_DISPATCHER_PROVIDER,
6-
CompatibilityModule,
6+
MdCommonModule,
77
FocusOriginMonitor,
88
} from '../core';
99

1010

1111
@NgModule({
12-
imports: [FormsModule, CompatibilityModule],
12+
imports: [FormsModule, MdCommonModule],
1313
exports: [
1414
MdButtonToggleGroup,
1515
MdButtonToggleGroupMultiple,
1616
MdButtonToggle,
17-
CompatibilityModule,
17+
MdCommonModule,
1818
],
1919
declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
2020
providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor]

src/lib/button/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ModuleWithProviders, NgModule} from '@angular/core';
22
import {CommonModule} from '@angular/common';
3-
import {CompatibilityModule, MdRippleModule, StyleModule} from '../core';
3+
import {MdCommonModule, MdRippleModule, StyleModule} from '../core';
44
import {
55
MdAnchor,
66
MdButton,
@@ -19,13 +19,13 @@ export * from './button';
1919
imports: [
2020
CommonModule,
2121
MdRippleModule,
22-
CompatibilityModule,
22+
MdCommonModule,
2323
StyleModule,
2424
],
2525
exports: [
2626
MdButton,
2727
MdAnchor,
28-
CompatibilityModule,
28+
MdCommonModule,
2929
MdButtonCssMatStyler,
3030
MdRaisedButtonCssMatStyler,
3131
MdIconButtonCssMatStyler,

src/lib/card/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {NgModule, ModuleWithProviders} from '@angular/core';
2-
import {CompatibilityModule} from '../core';
2+
import {MdCommonModule} from '../core';
33
import {
44
MdCard,
55
MdCardHeader,
@@ -19,7 +19,7 @@ import {
1919

2020

2121
@NgModule({
22-
imports: [CompatibilityModule],
22+
imports: [MdCommonModule],
2323
exports: [
2424
MdCard,
2525
MdCardHeader,
@@ -35,7 +35,7 @@ import {
3535
MdCardImage,
3636
MdCardXlImage,
3737
MdCardAvatar,
38-
CompatibilityModule,
38+
MdCommonModule,
3939
],
4040
declarations: [
4141
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,

src/lib/checkbox/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {NgModule, ModuleWithProviders} from '@angular/core';
22
import {CommonModule} from '@angular/common';
3-
import {MdRippleModule, CompatibilityModule, FocusOriginMonitor} from '../core';
3+
import {MdRippleModule, MdCommonModule, FocusOriginMonitor} from '../core';
44
import {MdCheckbox} from './checkbox';
55

66

77
@NgModule({
8-
imports: [CommonModule, MdRippleModule, CompatibilityModule],
9-
exports: [MdCheckbox, CompatibilityModule],
8+
imports: [CommonModule, MdRippleModule, MdCommonModule],
9+
exports: [MdCheckbox, MdCommonModule],
1010
declarations: [MdCheckbox],
1111
providers: [FocusOriginMonitor]
1212
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {NgModule} from '@angular/core';
2+
import {CompatibilityModule} from '../compatibility/compatibility';
3+
4+
5+
/**
6+
* Module that captures anything that should be loaded and/or run for *all* Angular Material
7+
* components. This includes Bidi, compatibility mode, etc.
8+
*
9+
* This module should be imported to each top-level component module (e.g., MdTabsModule).
10+
*/
11+
@NgModule({
12+
imports: [CompatibilityModule],
13+
exports: [CompatibilityModule],
14+
})
15+
export class MdCommonModule { }

src/lib/core/core.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ export {coerceNumberProperty} from './coercion/number-property';
113113
// Compatibility
114114
export {CompatibilityModule, NoConflictStyleCompatibilityMode} from './compatibility/compatibility';
115115

116+
// Common material module
117+
export {MdCommonModule} from './common-behaviors/common-module';
118+
116119

117120
@NgModule({
118121
imports: [

src/lib/core/line/line.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ElementRef,
66
QueryList
77
} from '@angular/core';
8-
import {CompatibilityModule} from '../compatibility/compatibility';
8+
import {MdCommonModule} from '../common-behaviors/common-module';
99

1010

1111
/**
@@ -57,8 +57,8 @@ export class MdLineSetter {
5757
}
5858

5959
@NgModule({
60-
imports: [CompatibilityModule],
61-
exports: [MdLine, CompatibilityModule],
60+
imports: [MdCommonModule],
61+
exports: [MdLine, MdCommonModule],
6262
declarations: [MdLine],
6363
})
6464
export class MdLineModule { }

src/lib/core/ripple/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ModuleWithProviders, NgModule} from '@angular/core';
22
import {MdRipple} from './ripple';
3-
import {CompatibilityModule} from '../compatibility/compatibility';
3+
import {MdCommonModule} from '../common-behaviors/common-module';
44
import {VIEWPORT_RULER_PROVIDER} from '../overlay/position/viewport-ruler';
55
import {SCROLL_DISPATCHER_PROVIDER} from '../overlay/scroll/scroll-dispatcher';
66

@@ -9,8 +9,8 @@ export {RippleRef, RippleState} from './ripple-ref';
99
export {RippleConfig, RIPPLE_FADE_IN_DURATION, RIPPLE_FADE_OUT_DURATION} from './ripple-renderer';
1010

1111
@NgModule({
12-
imports: [CompatibilityModule],
13-
exports: [MdRipple, CompatibilityModule],
12+
imports: [MdCommonModule],
13+
exports: [MdRipple, MdCommonModule],
1414
declarations: [MdRipple],
1515
providers: [VIEWPORT_RULER_PROVIDER, SCROLL_DISPATCHER_PROVIDER],
1616
})

src/lib/dialog/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
OverlayModule,
55
PortalModule,
66
A11yModule,
7-
CompatibilityModule,
7+
MdCommonModule,
88
} from '../core';
99
import {MdDialog} from './dialog';
1010
import {MdDialogContainer} from './dialog-container';
@@ -22,15 +22,15 @@ import {
2222
OverlayModule,
2323
PortalModule,
2424
A11yModule,
25-
CompatibilityModule,
25+
MdCommonModule,
2626
],
2727
exports: [
2828
MdDialogContainer,
2929
MdDialogClose,
3030
MdDialogTitle,
3131
MdDialogContent,
3232
MdDialogActions,
33-
CompatibilityModule,
33+
MdCommonModule,
3434
],
3535
declarations: [
3636
MdDialogContainer,

0 commit comments

Comments
 (0)