Skip to content

Commit 56c2468

Browse files
committed
add to modules
1 parent e7af98b commit 56c2468

File tree

23 files changed

+61
-27
lines changed

23 files changed

+61
-27
lines changed

src/lib/button-toggle/button-toggle.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,12 @@ export class MdButtonToggle implements OnInit {
442442

443443
@NgModule({
444444
imports: [FormsModule, DefaultStyleCompatibilityModeModule],
445-
exports: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
445+
exports: [
446+
MdButtonToggleGroup,
447+
MdButtonToggleGroupMultiple,
448+
MdButtonToggle,
449+
DefaultStyleCompatibilityModeModule,
450+
],
446451
declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
447452
})
448453
export class MdButtonToggleModule {

src/lib/button/button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class MdAnchor extends MdButton {
159159

160160
@NgModule({
161161
imports: [CommonModule, MdRippleModule, DefaultStyleCompatibilityModeModule],
162-
exports: [MdButton, MdAnchor],
162+
exports: [MdButton, MdAnchor, DefaultStyleCompatibilityModeModule],
163163
declarations: [MdButton, MdAnchor],
164164
})
165165
export class MdButtonModule {

src/lib/card/card.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,15 @@ export class MdCardTitleGroup {}
127127
@NgModule({
128128
imports: [DefaultStyleCompatibilityModeModule],
129129
exports: [
130-
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,
131-
MdCardActions, MdCardFooter
130+
MdCard,
131+
MdCardHeader,
132+
MdCardTitleGroup,
133+
MdCardContent,
134+
MdCardTitle,
135+
MdCardSubtitle,
136+
MdCardActions,
137+
MdCardFooter,
138+
DefaultStyleCompatibilityModeModule,
132139
],
133140
declarations: [
134141
MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle,

src/lib/checkbox/checkbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export class MdCheckbox implements ControlValueAccessor {
380380

381381
@NgModule({
382382
imports: [CommonModule, MdRippleModule, DefaultStyleCompatibilityModeModule],
383-
exports: [MdCheckbox],
383+
exports: [MdCheckbox, DefaultStyleCompatibilityModeModule],
384384
declarations: [MdCheckbox],
385385
})
386386
export class MdCheckboxModule {

src/lib/core/compatibility/compatibility.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ import {MdCheckboxModule} from '../../checkbox/checkbox';
44
import {NoConflictStyleCompatibilityMode} from './no-conflict-mode';
55

66

7-
fdescribe('Style compatibility', () => {
7+
describe('Style compatibility', () => {
88

99
describe('in default mode', () => {
1010
beforeEach(async(() => {
1111
TestBed.configureTestingModule({
12+
// Specifically do *not* directly import the DefaultStyleCompatibilityModeModule
13+
// to ensure that it is the default behavior.
1214
imports: [MdCheckboxModule.forRoot()],
1315
declarations: [ComponentWithMdCheckbox, ComponentWithMatCheckbox],
1416
});
1517

1618
TestBed.compileComponents();
1719
}));
18-
19-
20+
2021
it('should throw an error when trying to use the "mat-" prefix', () => {
2122
expect(() => {
2223
TestBed.createComponent(ComponentWithMatCheckbox);
2324
}).toThrowError(/The "mat-" prefix cannot be used out of ng-material v1 compatibility mode/);
24-
});
25+
});
2526
});
2627

2728
describe('in no-conflict mode', () => {
@@ -33,7 +34,7 @@ fdescribe('Style compatibility', () => {
3334

3435
TestBed.compileComponents();
3536
}));
36-
37+
3738
it('should not throw an error when trying to use the "mat-" prefix', () => {
3839
TestBed.createComponent(ComponentWithMatCheckbox);
3940
});

src/lib/core/compatibility/default-mode.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export class MatPrefixEnforcer {
5454
}
5555

5656

57+
/**
58+
* Module that enforces the default "compatibility mode" settings. When this module is loaded
59+
* without NoConflictStyleCompatibilityMode also being imported, it will throw an error if
60+
* there are any uses of the `mat-` prefix.
61+
*
62+
* Because the point of this directive is to *not* be used, it will be tree-shaken away by
63+
* optimizers when not in compatibility mode.
64+
*/
5765
@NgModule({
5866
declarations: [MatPrefixEnforcer],
5967
exports: [MatPrefixEnforcer],

src/lib/core/line/line.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class MdLineSetter {
5050

5151
@NgModule({
5252
imports: [DefaultStyleCompatibilityModeModule],
53-
exports: [MdLine],
53+
exports: [MdLine, DefaultStyleCompatibilityModeModule],
5454
declarations: [MdLine],
5555
})
5656
export class MdLineModule { }

src/lib/core/ripple/ripple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class MdRipple implements OnInit, OnDestroy, OnChanges {
180180

181181
@NgModule({
182182
imports: [DefaultStyleCompatibilityModeModule],
183-
exports: [MdRipple],
183+
exports: [MdRipple, DefaultStyleCompatibilityModeModule],
184184
declarations: [MdRipple],
185185
})
186186
export class MdRippleModule {

src/lib/dialog/dialog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function _applyConfigDefaults(dialogConfig: MdDialogConfig): MdDialogConfig {
155155

156156
@NgModule({
157157
imports: [OverlayModule, PortalModule, A11yModule, DefaultStyleCompatibilityModeModule],
158-
exports: [MdDialogContainer],
158+
exports: [MdDialogContainer, DefaultStyleCompatibilityModeModule],
159159
declarations: [MdDialogContainer],
160160
entryComponents: [MdDialogContainer],
161161
})

src/lib/grid-list/grid-list.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ export class MdGridList implements OnInit, AfterContentChecked {
153153

154154
@NgModule({
155155
imports: [MdLineModule, DefaultStyleCompatibilityModeModule],
156-
exports: [MdGridList, MdGridTile, MdGridTileText, MdLineModule],
156+
exports: [
157+
MdGridList,
158+
MdGridTile,
159+
MdGridTileText,
160+
MdLineModule,
161+
DefaultStyleCompatibilityModeModule,
162+
],
157163
declarations: [MdGridList, MdGridTile, MdGridTileText],
158164
})
159165
export class MdGridListModule {

0 commit comments

Comments
 (0)