Skip to content

Commit

Permalink
fix: remove deprecated forRoot functions
Browse files Browse the repository at this point in the history
* In beta.2 the `forRoot` calls have been deprecated, and it was stated that those will be removed in the next release (https://goo.gl/2yFPFc)
  • Loading branch information
devversion committed Mar 9, 2017
1 parent ce0e933 commit 10964c1
Show file tree
Hide file tree
Showing 68 changed files with 208 additions and 490 deletions.
2 changes: 1 addition & 1 deletion src/demo-app/demo-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {StyleDemo} from './style/style-demo';
HttpModule,
ReactiveFormsModule,
RouterModule.forRoot(DEMO_APP_ROUTES),
MaterialModule.forRoot(),
MaterialModule,
MdSelectionModule,
],
declarations: [
Expand Down
2 changes: 1 addition & 1 deletion src/e2e-app/e2e-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {SlideToggleE2E} from './slide-toggle/slide-toggle-e2e';
imports: [
BrowserModule,
RouterModule.forRoot(E2E_APP_ROUTES),
MaterialModule.forRoot(),
MaterialModule,
],
declarations: [
E2EApp,
Expand Down
4 changes: 3 additions & 1 deletion src/lib/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ describe('MdAutocomplete', () => {
dir = 'ltr';
TestBed.configureTestingModule({
imports: [
MdAutocompleteModule.forRoot(), MdInputModule.forRoot(), ReactiveFormsModule
MdAutocompleteModule,
MdInputModule,
ReactiveFormsModule
],
declarations: [SimpleAutocomplete, AutocompleteWithoutForms, NgIfAutocomplete],
providers: [
Expand Down
10 changes: 1 addition & 9 deletions src/lib/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ import {MdAutocompleteTrigger} from './autocomplete-trigger';
exports: [MdAutocomplete, MdOptionModule, MdAutocompleteTrigger, CompatibilityModule],
declarations: [MdAutocomplete, MdAutocompleteTrigger],
})
export class MdAutocompleteModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdAutocompleteModule,
providers: [OVERLAY_PROVIDERS]
};
}
}
export class MdAutocompleteModule {}


export * from './autocomplete';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/button-toggle/button-toggle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('MdButtonToggle', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdButtonToggleModule.forRoot(), FormsModule, ReactiveFormsModule],
imports: [MdButtonToggleModule, FormsModule, ReactiveFormsModule],
declarations: [
ButtonTogglesInsideButtonToggleGroup,
ButtonToggleGroupWithNgModel,
Expand Down
10 changes: 1 addition & 9 deletions src/lib/button-toggle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ import {
declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle],
providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor]
})
export class MdButtonToggleModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdButtonToggleModule,
providers: []
};
}
}
export class MdButtonToggleModule {}


export * from './button-toggle';
2 changes: 1 addition & 1 deletion src/lib/button/button.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('MdButton', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdButtonModule.forRoot()],
imports: [MdButtonModule],
declarations: [TestApp],
providers: [
{provide: ViewportRuler, useClass: FakeViewportRuler},
Expand Down
10 changes: 1 addition & 9 deletions src/lib/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ import {
MdMiniFabCssMatStyler
],
})
export class MdButtonModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdButtonModule,
providers: []
};
}
}
export class MdButtonModule {}


export * from './button';
10 changes: 1 addition & 9 deletions src/lib/card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,7 @@ import {
MdCardXlImage, MdCardAvatar,
],
})
export class MdCardModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdCardModule,
providers: []
};
}
}
export class MdCardModule {}


export * from './card';
2 changes: 1 addition & 1 deletion src/lib/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('MdCheckbox', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdCheckboxModule.forRoot(), FormsModule, ReactiveFormsModule],
imports: [MdCheckboxModule, FormsModule, ReactiveFormsModule],
declarations: [
SingleCheckbox,
CheckboxWithFormDirectives,
Expand Down
10 changes: 1 addition & 9 deletions src/lib/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ import {MdCheckbox} from './checkbox';
declarations: [MdCheckbox],
providers: [FocusOriginMonitor]
})
export class MdCheckboxModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdCheckboxModule,
providers: []
};
}
}
export class MdCheckboxModule {}


export * from './checkbox';
2 changes: 1 addition & 1 deletion src/lib/chips/chip-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('MdChipList', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdChipsModule.forRoot()],
imports: [MdChipsModule],
declarations: [
StaticChipList
]
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chips/chip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Chips', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdChipsModule.forRoot()],
imports: [MdChipsModule],
declarations: [
BasicChip, SingleChip
]
Expand Down
10 changes: 1 addition & 9 deletions src/lib/chips/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ import {MdChip} from './chip';
exports: [MdChipList, MdChip],
declarations: [MdChipList, MdChip]
})
export class MdChipsModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdChipsModule,
providers: []
};
}
}
export class MdChipsModule {}


export * from './chip-list';
Expand Down
10 changes: 1 addition & 9 deletions src/lib/core/a11y/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,4 @@ import {PlatformModule} from '../platform/index';
exports: [FocusTrapDirective, FocusTrapDeprecatedDirective],
providers: [InteractivityChecker, FocusTrapFactory, LIVE_ANNOUNCER_PROVIDER]
})
export class A11yModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: A11yModule,
providers: [],
};
}
}
export class A11yModule {}
6 changes: 3 additions & 3 deletions src/lib/core/compatibility/compatibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Style compatibility', () => {
TestBed.configureTestingModule({
// Specifically do *not* directly import the DefaultStyleCompatibilityModeModule
// to ensure that it is the default behavior.
imports: [MdCheckboxModule.forRoot()],
imports: [MdCheckboxModule],
declarations: [ComponentWithMdCheckbox, ComponentWithMatCheckbox],
});

Expand All @@ -41,7 +41,7 @@ describe('Style compatibility', () => {
describe('in no-conflict mode', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MdCheckboxModule.forRoot(), NoConflictStyleCompatibilityMode],
imports: [MdCheckboxModule, NoConflictStyleCompatibilityMode],
declarations: [ComponentWithMdCheckbox, ComponentWithMatCheckbox],
});

Expand Down Expand Up @@ -89,7 +89,7 @@ class ComponentWithMatCheckbox { }


@NgModule({
imports: [MdCheckboxModule.forRoot()],
imports: [MdCheckboxModule],
exports: [ComponentWithMdCheckbox, ComponentWithMatCheckbox],
declarations: [ComponentWithMdCheckbox, ComponentWithMatCheckbox],
})
Expand Down
9 changes: 1 addition & 8 deletions src/lib/core/compatibility/compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,7 @@ export class MdPrefixRejector {
declarations: [MatPrefixRejector, MdPrefixRejector],
exports: [MatPrefixRejector, MdPrefixRejector],
})
export class CompatibilityModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: CompatibilityModule,
providers: [],
};
}
}
export class CompatibilityModule {}


/**
Expand Down
10 changes: 1 addition & 9 deletions src/lib/core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,4 @@ export {CompatibilityModule, NoConflictStyleCompatibilityMode} from './compatibi
MdSelectionModule,
],
})
export class MdCoreModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdCoreModule,
providers: [],
};
}
}
export class MdCoreModule {}
10 changes: 1 addition & 9 deletions src/lib/core/observe-content/observe-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,4 @@ export class ObserveContent implements AfterContentInit, OnDestroy {
exports: [ObserveContent],
declarations: [ObserveContent]
})
export class ObserveContentModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: ObserveContentModule,
providers: []
};
}
}
export class ObserveContentModule {}
9 changes: 1 addition & 8 deletions src/lib/core/option/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,4 @@ export class MdOption {
exports: [MdOption],
declarations: [MdOption]
})
export class MdOptionModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: MdOptionModule,
providers: []
};
}
}
export class MdOptionModule {}
2 changes: 1 addition & 1 deletion src/lib/core/overlay/overlay-directives.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Overlay directives', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [OverlayModule.forRoot()],
imports: [OverlayModule],
declarations: [ConnectedOverlayDirectiveTest],
providers: [
{provide: OverlayContainer, useFactory: () => {
Expand Down
10 changes: 1 addition & 9 deletions src/lib/core/overlay/overlay-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,4 @@ export class ConnectedOverlayDirective implements OnDestroy {
declarations: [ConnectedOverlayDirective, OverlayOrigin, Scrollable],
providers: [OVERLAY_PROVIDERS],
})
export class OverlayModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: OverlayModule,
providers: [],
};
}
}
export class OverlayModule {}
2 changes: 1 addition & 1 deletion src/lib/core/overlay/overlay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Overlay', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [OverlayModule.forRoot(), PortalModule, OverlayTestModule],
imports: [OverlayModule, PortalModule, OverlayTestModule],
providers: [
{provide: OverlayContainer, useFactory: () => {
overlayContainerElement = document.createElement('div');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/overlay/scroll/scroll-dispatcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Scroll Dispatcher', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [OverlayModule.forRoot(), ScrollTestModule],
imports: [OverlayModule, ScrollTestModule],
});

TestBed.compileComponents();
Expand Down
10 changes: 1 addition & 9 deletions src/lib/core/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ import {Platform} from './platform';
@NgModule({
providers: [Platform]
})
export class PlatformModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: PlatformModule,
providers: [],
};
}
}
export class PlatformModule {}


export * from './platform';
Expand Down
10 changes: 1 addition & 9 deletions src/lib/core/portal/portal-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,4 @@ export class PortalHostDirective extends BasePortalHost implements OnDestroy {
exports: [TemplatePortalDirective, PortalHostDirective],
declarations: [TemplatePortalDirective, PortalHostDirective],
})
export class PortalModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: PortalModule,
providers: []
};
}
}
export class PortalModule {}
2 changes: 1 addition & 1 deletion src/lib/core/portal/portal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Portals', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [PortalModule.forRoot(), PortalTestModule],
imports: [PortalModule, PortalTestModule],
});

TestBed.compileComponents();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/projection/projection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ProjectionModule, DomProjection, DomProjectionHost} from './projection';
describe('Projection', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ProjectionModule.forRoot(), ProjectionTestModule],
imports: [ProjectionModule, ProjectionTestModule],
});

TestBed.compileComponents();
Expand Down
9 changes: 1 addition & 8 deletions src/lib/core/projection/projection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,4 @@ export class DomProjection {
declarations: [DomProjectionHost],
providers: [DomProjection],
})
export class ProjectionModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: ProjectionModule,
};
}
}
export class ProjectionModule {}
10 changes: 1 addition & 9 deletions src/lib/core/ripple/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,4 @@ export {RippleConfig} from './ripple-renderer';
declarations: [MdRipple],
providers: [VIEWPORT_RULER_PROVIDER, SCROLL_DISPATCHER_PROVIDER],
})
export class MdRippleModule {
/** @deprecated */
static forRoot(): ModuleWithProviders {
return {
ngModule: MdRippleModule,
providers: []
};
}
}
export class MdRippleModule {}
Loading

0 comments on commit 10964c1

Please sign in to comment.