diff --git a/src/lib/autocomplete/index.ts b/src/lib/autocomplete/index.ts index 9cbfc471ee27..7694e665ebbc 100644 --- a/src/lib/autocomplete/index.ts +++ b/src/lib/autocomplete/index.ts @@ -4,8 +4,6 @@ import {MdOptionModule, OverlayModule, OVERLAY_PROVIDERS, CompatibilityModule} f import {CommonModule} from '@angular/common'; import {MdAutocomplete} from './autocomplete'; import {MdAutocompleteTrigger} from './autocomplete-trigger'; -export * from './autocomplete'; -export * from './autocomplete-trigger'; @NgModule({ imports: [MdOptionModule, OverlayModule, CompatibilityModule, CommonModule], @@ -21,3 +19,7 @@ export class MdAutocompleteModule { }; } } + + +export * from './autocomplete'; +export * from './autocomplete-trigger'; diff --git a/src/lib/button-toggle/button-toggle.spec.ts b/src/lib/button-toggle/button-toggle.spec.ts index d6907b557ccb..6050dd4449a9 100644 --- a/src/lib/button-toggle/button-toggle.spec.ts +++ b/src/lib/button-toggle/button-toggle.spec.ts @@ -9,11 +9,12 @@ import {NgControl, FormsModule, ReactiveFormsModule, FormControl} from '@angular import {Component, DebugElement} from '@angular/core'; import {By} from '@angular/platform-browser'; import { - MdButtonToggleGroup, - MdButtonToggle, - MdButtonToggleGroupMultiple, - MdButtonToggleChange, MdButtonToggleModule, -} from './button-toggle'; + MdButtonToggleGroup, + MdButtonToggle, + MdButtonToggleGroupMultiple, + MdButtonToggleChange, + MdButtonToggleModule, +} from './index'; describe('MdButtonToggle', () => { diff --git a/src/lib/button-toggle/button-toggle.ts b/src/lib/button-toggle/button-toggle.ts index 7bc964988040..3cc0a0c21209 100644 --- a/src/lib/button-toggle/button-toggle.ts +++ b/src/lib/button-toggle/button-toggle.ts @@ -1,32 +1,24 @@ import { - NgModule, - ModuleWithProviders, - Component, - ContentChildren, - Directive, - ElementRef, - Renderer, - EventEmitter, - HostBinding, - Input, - OnInit, - Optional, - Output, - QueryList, - ViewChild, - ViewEncapsulation, - forwardRef, - AfterViewInit + Component, + ContentChildren, + Directive, + ElementRef, + Renderer, + EventEmitter, + HostBinding, + Input, + OnInit, + Optional, + Output, + QueryList, + ViewChild, + ViewEncapsulation, + forwardRef, + AfterViewInit, } from '@angular/core'; -import {NG_VALUE_ACCESSOR, ControlValueAccessor, FormsModule} from '@angular/forms'; +import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; import {Observable} from 'rxjs/Observable'; -import { - FocusOriginMonitor, - UniqueSelectionDispatcher, - coerceBooleanProperty, - UNIQUE_SELECTION_DISPATCHER_PROVIDER, - CompatibilityModule, -} from '../core'; +import {UniqueSelectionDispatcher, coerceBooleanProperty, FocusOriginMonitor} from '../core'; /** Acceptable types for a button toggle. */ export type ToggleType = 'checkbox' | 'radio'; @@ -469,25 +461,3 @@ export class MdButtonToggle implements OnInit { this._renderer.invokeElementMethod(this._inputElement.nativeElement, 'focus'); } } - - -@NgModule({ - imports: [FormsModule, CompatibilityModule], - exports: [ - MdButtonToggleGroup, - MdButtonToggleGroupMultiple, - MdButtonToggle, - CompatibilityModule, - ], - declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle], - providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor] -}) -export class MdButtonToggleModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdButtonToggleModule, - providers: [] - }; - } -} diff --git a/src/lib/button-toggle/index.ts b/src/lib/button-toggle/index.ts index 9c447d60f111..a2967210997c 100644 --- a/src/lib/button-toggle/index.ts +++ b/src/lib/button-toggle/index.ts @@ -1 +1,33 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {FormsModule} from '@angular/forms'; +import {MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle} from './button-toggle'; +import { + UNIQUE_SELECTION_DISPATCHER_PROVIDER, + CompatibilityModule, + FocusOriginMonitor, +} from '../core'; + + +@NgModule({ + imports: [FormsModule, CompatibilityModule], + exports: [ + MdButtonToggleGroup, + MdButtonToggleGroupMultiple, + MdButtonToggle, + CompatibilityModule, + ], + declarations: [MdButtonToggleGroup, MdButtonToggleGroupMultiple, MdButtonToggle], + providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, FocusOriginMonitor] +}) +export class MdButtonToggleModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdButtonToggleModule, + providers: [] + }; + } +} + + export * from './button-toggle'; diff --git a/src/lib/button/button.spec.ts b/src/lib/button/button.spec.ts index 564a3a29d0f3..aba70a71e02e 100644 --- a/src/lib/button/button.spec.ts +++ b/src/lib/button/button.spec.ts @@ -1,7 +1,7 @@ import {async, TestBed, ComponentFixture} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdButtonModule} from './button'; +import {MdButtonModule} from './index'; import {ViewportRuler} from '../core/overlay/position/viewport-ruler'; import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler'; diff --git a/src/lib/button/button.ts b/src/lib/button/button.ts index 029e152a12dc..8cddd0d647a3 100644 --- a/src/lib/button/button.ts +++ b/src/lib/button/button.ts @@ -6,11 +6,9 @@ import { ChangeDetectionStrategy, ElementRef, Renderer, - NgModule, - ModuleWithProviders, Directive, + Directive, } from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {MdRippleModule, coerceBooleanProperty, CompatibilityModule} from '../core'; +import {coerceBooleanProperty} from '../core'; // TODO(jelbourn): Make the `isMouseDown` stuff done with one global listener. @@ -219,35 +217,3 @@ export class MdAnchor extends MdButton { } } } - - -@NgModule({ - imports: [CommonModule, MdRippleModule, CompatibilityModule], - exports: [ - MdButton, MdAnchor, - CompatibilityModule, - MdButtonCssMatStyler, - MdRaisedButtonCssMatStyler, - MdIconButtonCssMatStyler, - MdFabCssMatStyler, - MdMiniFabCssMatStyler - ], - declarations: [ - MdButton, - MdAnchor, - MdButtonCssMatStyler, - MdRaisedButtonCssMatStyler, - MdIconButtonCssMatStyler, - MdFabCssMatStyler, - MdMiniFabCssMatStyler - ], -}) -export class MdButtonModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdButtonModule, - providers: [] - }; - } -} diff --git a/src/lib/button/index.ts b/src/lib/button/index.ts index eaf5eea7f1c1..1f96453f5290 100644 --- a/src/lib/button/index.ts +++ b/src/lib/button/index.ts @@ -1 +1,48 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {MdRippleModule, CompatibilityModule} from '../core'; +import { + MdButton, + MdAnchor, + MdButtonCssMatStyler, + MdRaisedButtonCssMatStyler, + MdIconButtonCssMatStyler, + MdFabCssMatStyler, + MdMiniFabCssMatStyler, +} from './button'; + + +@NgModule({ + imports: [CommonModule, MdRippleModule, CompatibilityModule], + exports: [ + MdButton, + MdAnchor, + CompatibilityModule, + MdButtonCssMatStyler, + MdRaisedButtonCssMatStyler, + MdIconButtonCssMatStyler, + MdFabCssMatStyler, + MdMiniFabCssMatStyler + ], + declarations: [ + MdButton, + MdAnchor, + MdButtonCssMatStyler, + MdRaisedButtonCssMatStyler, + MdIconButtonCssMatStyler, + MdFabCssMatStyler, + MdMiniFabCssMatStyler + ], +}) +export class MdButtonModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdButtonModule, + providers: [] + }; + } +} + + export * from './button'; diff --git a/src/lib/card/card.ts b/src/lib/card/card.ts index 8db5bbabe612..68745e0027b7 100644 --- a/src/lib/card/card.ts +++ b/src/lib/card/card.ts @@ -1,12 +1,9 @@ import { - NgModule, - ModuleWithProviders, Component, ViewEncapsulation, ChangeDetectionStrategy, Directive } from '@angular/core'; -import {CompatibilityModule} from '../core'; /** @@ -188,39 +185,3 @@ export class MdCardHeader {} } }) export class MdCardTitleGroup {} - - -@NgModule({ - imports: [CompatibilityModule], - exports: [ - MdCard, - MdCardHeader, - MdCardTitleGroup, - MdCardContent, - MdCardTitle, - MdCardSubtitle, - MdCardActions, - MdCardFooter, - MdCardSmImage, - MdCardMdImage, - MdCardLgImage, - MdCardImage, - MdCardXlImage, - MdCardAvatar, - CompatibilityModule, - ], - declarations: [ - MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle, - MdCardActions, MdCardFooter, MdCardSmImage, MdCardMdImage, MdCardLgImage, MdCardImage, - MdCardXlImage, MdCardAvatar, - ], -}) -export class MdCardModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdCardModule, - providers: [] - }; - } -} diff --git a/src/lib/card/index.ts b/src/lib/card/index.ts index cb5809fedb2d..1b6a7934ce3e 100644 --- a/src/lib/card/index.ts +++ b/src/lib/card/index.ts @@ -1 +1,57 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CompatibilityModule} from '../core'; +import { + MdCard, + MdCardHeader, + MdCardTitleGroup, + MdCardContent, + MdCardTitle, + MdCardSubtitle, + MdCardActions, + MdCardFooter, + MdCardSmImage, + MdCardMdImage, + MdCardLgImage, + MdCardImage, + MdCardXlImage, + MdCardAvatar, +} from './card'; + + +@NgModule({ + imports: [CompatibilityModule], + exports: [ + MdCard, + MdCardHeader, + MdCardTitleGroup, + MdCardContent, + MdCardTitle, + MdCardSubtitle, + MdCardActions, + MdCardFooter, + MdCardSmImage, + MdCardMdImage, + MdCardLgImage, + MdCardImage, + MdCardXlImage, + MdCardAvatar, + CompatibilityModule, + ], + declarations: [ + MdCard, MdCardHeader, MdCardTitleGroup, MdCardContent, MdCardTitle, MdCardSubtitle, + MdCardActions, MdCardFooter, MdCardSmImage, MdCardMdImage, MdCardLgImage, MdCardImage, + MdCardXlImage, MdCardAvatar, + ], +}) +export class MdCardModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdCardModule, + providers: [] + }; + } +} + + export * from './card'; diff --git a/src/lib/checkbox/checkbox.spec.ts b/src/lib/checkbox/checkbox.spec.ts index a6342eaa76e1..4f75c88051b0 100644 --- a/src/lib/checkbox/checkbox.spec.ts +++ b/src/lib/checkbox/checkbox.spec.ts @@ -9,7 +9,7 @@ import { import {NgControl, FormsModule, ReactiveFormsModule, FormControl} from '@angular/forms'; import {Component, DebugElement} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdCheckbox, MdCheckboxChange, MdCheckboxModule} from './checkbox'; +import {MdCheckbox, MdCheckboxChange, MdCheckboxModule} from './index'; import {ViewportRuler} from '../core/overlay/position/viewport-ruler'; import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler'; import {dispatchFakeEvent} from '../core/testing/dispatch-events'; diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index a935e2d2ef14..dcbc59074de5 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -1,27 +1,22 @@ import { - ChangeDetectorRef, - ChangeDetectionStrategy, - Component, - ElementRef, - EventEmitter, - Input, - Output, - Renderer, - ViewEncapsulation, - forwardRef, - NgModule, - ModuleWithProviders, - ViewChild, - AfterViewInit, - OnDestroy, + ChangeDetectorRef, + ChangeDetectionStrategy, + Component, + ElementRef, + EventEmitter, + Input, + Output, + Renderer, + ViewEncapsulation, + forwardRef, + ViewChild, + AfterViewInit, + OnDestroy, } from '@angular/core'; -import {CommonModule} from '@angular/common'; import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; import {coerceBooleanProperty} from '../core/coercion/boolean-property'; import {Subscription} from 'rxjs/Subscription'; import { - CompatibilityModule, - MdRippleModule, MdRipple, RippleRef, FocusOriginMonitor, @@ -443,20 +438,3 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro } } } - - -@NgModule({ - imports: [CommonModule, MdRippleModule, CompatibilityModule], - exports: [MdCheckbox, CompatibilityModule], - declarations: [MdCheckbox], - providers: [FocusOriginMonitor] -}) -export class MdCheckboxModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdCheckboxModule, - providers: [] - }; - } -} diff --git a/src/lib/checkbox/index.ts b/src/lib/checkbox/index.ts index 8d78b3e23f25..f468d3a5560c 100644 --- a/src/lib/checkbox/index.ts +++ b/src/lib/checkbox/index.ts @@ -1 +1,24 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {MdRippleModule, CompatibilityModule, FocusOriginMonitor} from '../core'; +import {MdCheckbox} from './checkbox'; + + +@NgModule({ + imports: [CommonModule, MdRippleModule, CompatibilityModule], + exports: [MdCheckbox, CompatibilityModule], + declarations: [MdCheckbox], + providers: [FocusOriginMonitor] +}) +export class MdCheckboxModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdCheckboxModule, + providers: [] + }; + } +} + + export * from './checkbox'; diff --git a/src/lib/chips/chip-list.ts b/src/lib/chips/chip-list.ts index af563c4660c6..7c4a396cf84c 100644 --- a/src/lib/chips/chip-list.ts +++ b/src/lib/chips/chip-list.ts @@ -5,8 +5,6 @@ import { ContentChildren, ElementRef, Input, - ModuleWithProviders, - NgModule, QueryList, ViewEncapsulation } from '@angular/core'; @@ -208,18 +206,3 @@ export class MdChipList implements AfterContentInit { } } - -@NgModule({ - imports: [], - exports: [MdChipList, MdChip], - declarations: [MdChipList, MdChip] -}) -export class MdChipsModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdChipsModule, - providers: [] - }; - } -} diff --git a/src/lib/chips/index.ts b/src/lib/chips/index.ts index 938151ce2bea..6b6d4e4e3192 100644 --- a/src/lib/chips/index.ts +++ b/src/lib/chips/index.ts @@ -1,2 +1,23 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {MdChipList} from './chip-list'; +import {MdChip} from './chip'; + + +@NgModule({ + imports: [], + exports: [MdChipList, MdChip], + declarations: [MdChipList, MdChip] +}) +export class MdChipsModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdChipsModule, + providers: [] + }; + } +} + + export * from './chip-list'; export * from './chip'; diff --git a/src/lib/core/compatibility/compatibility.spec.ts b/src/lib/core/compatibility/compatibility.spec.ts index 4e9e754fac81..479ee3b13bf0 100644 --- a/src/lib/core/compatibility/compatibility.spec.ts +++ b/src/lib/core/compatibility/compatibility.spec.ts @@ -1,6 +1,6 @@ import {Component, NgModule} from '@angular/core'; import {async, TestBed} from '@angular/core/testing'; -import {MdCheckboxModule} from '../../checkbox/checkbox'; +import {MdCheckboxModule} from '../../checkbox/index'; import { NoConflictStyleCompatibilityMode, MAT_ELEMENTS_SELECTOR, diff --git a/src/lib/core/platform/index.ts b/src/lib/core/platform/index.ts index edb7dae39703..0009bf35f80f 100644 --- a/src/lib/core/platform/index.ts +++ b/src/lib/core/platform/index.ts @@ -1,9 +1,6 @@ import {NgModule, ModuleWithProviders} from '@angular/core'; import {Platform} from './platform'; -export * from './platform'; -export * from './features'; - @NgModule({ providers: [Platform] @@ -17,3 +14,7 @@ export class PlatformModule { }; } } + + +export * from './platform'; +export * from './features'; diff --git a/src/lib/core/selection/index.ts b/src/lib/core/selection/index.ts index 4ebd17960d72..5a6f826091fd 100644 --- a/src/lib/core/selection/index.ts +++ b/src/lib/core/selection/index.ts @@ -1,10 +1,12 @@ import {NgModule} from '@angular/core'; import {MdPseudoCheckbox} from './pseudo-checkbox/pseudo-checkbox'; -export * from './pseudo-checkbox/pseudo-checkbox'; @NgModule({ exports: [MdPseudoCheckbox], declarations: [MdPseudoCheckbox] }) export class MdSelectionModule { } + + +export * from './pseudo-checkbox/pseudo-checkbox'; diff --git a/src/lib/core/style/index.ts b/src/lib/core/style/index.ts index b5f487f54223..a61a25dbb43a 100644 --- a/src/lib/core/style/index.ts +++ b/src/lib/core/style/index.ts @@ -1,9 +1,6 @@ import {NgModule} from '@angular/core'; import {CdkMonitorFocus, FOCUS_ORIGIN_MONITOR_PROVIDER} from './focus-origin-monitor'; -export * from './focus-origin-monitor'; -export * from './apply-transform'; - @NgModule({ declarations: [CdkMonitorFocus], @@ -11,3 +8,7 @@ export * from './apply-transform'; providers: [FOCUS_ORIGIN_MONITOR_PROVIDER], }) export class StyleModule {} + + +export * from './focus-origin-monitor'; +export * from './apply-transform'; diff --git a/src/lib/grid-list/grid-list.spec.ts b/src/lib/grid-list/grid-list.spec.ts index 8683f55d8c85..5cc78dacb03b 100644 --- a/src/lib/grid-list/grid-list.spec.ts +++ b/src/lib/grid-list/grid-list.spec.ts @@ -1,7 +1,7 @@ import {async, TestBed} from '@angular/core/testing'; import {Component, DebugElement} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdGridList, MdGridListModule} from './grid-list'; +import {MdGridList, MdGridListModule} from './index'; import {MdGridTile, MdGridTileText} from './grid-tile'; diff --git a/src/lib/grid-list/grid-list.ts b/src/lib/grid-list/grid-list.ts index 92064ed024f4..8da4a76bceae 100644 --- a/src/lib/grid-list/grid-list.ts +++ b/src/lib/grid-list/grid-list.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, Component, ViewEncapsulation, AfterContentChecked, @@ -12,14 +10,11 @@ import { ElementRef, Optional, } from '@angular/core'; -import { - MdGridTile, MdGridTileText, MdGridTileFooterCssMatStyler, - MdGridTileHeaderCssMatStyler, MdGridAvatarCssMatStyler -} from './grid-tile'; +import {MdGridTile} from './grid-tile'; import {TileCoordinator} from './tile-coordinator'; import {TileStyler, FitTileStyler, RatioTileStyler, FixedTileStyler} from './tile-styler'; import {MdGridListColsError} from './grid-list-errors'; -import {Dir, MdLineModule, CompatibilityModule} from '../core'; +import {Dir} from '../core'; import { coerceToString, coerceToNumber, @@ -145,34 +140,3 @@ export class MdGridList implements OnInit, AfterContentChecked { } } } - - -@NgModule({ - imports: [MdLineModule, CompatibilityModule], - exports: [ - MdGridList, - MdGridTile, - MdGridTileText, - MdLineModule, - CompatibilityModule, - MdGridTileHeaderCssMatStyler, - MdGridTileFooterCssMatStyler, - MdGridAvatarCssMatStyler - ], - declarations: [ - MdGridList, - MdGridTile, - MdGridTileText, - MdGridTileHeaderCssMatStyler, - MdGridTileFooterCssMatStyler, - MdGridAvatarCssMatStyler], -}) -export class MdGridListModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdGridListModule, - providers: [] - }; - } -} diff --git a/src/lib/grid-list/index.ts b/src/lib/grid-list/index.ts index 981d0024533e..5206d2f7134c 100644 --- a/src/lib/grid-list/index.ts +++ b/src/lib/grid-list/index.ts @@ -1 +1,42 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {MdLineModule, CompatibilityModule} from '../core'; +import { + MdGridTile, MdGridTileText, MdGridTileFooterCssMatStyler, + MdGridTileHeaderCssMatStyler, MdGridAvatarCssMatStyler +} from './grid-tile'; +import {MdGridList} from './grid-list'; + + +@NgModule({ + imports: [MdLineModule, CompatibilityModule], + exports: [ + MdGridList, + MdGridTile, + MdGridTileText, + MdLineModule, + CompatibilityModule, + MdGridTileHeaderCssMatStyler, + MdGridTileFooterCssMatStyler, + MdGridAvatarCssMatStyler + ], + declarations: [ + MdGridList, + MdGridTile, + MdGridTileText, + MdGridTileHeaderCssMatStyler, + MdGridTileFooterCssMatStyler, + MdGridAvatarCssMatStyler + ], +}) +export class MdGridListModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdGridListModule, + providers: [] + }; + } +} + + export * from './grid-list'; diff --git a/src/lib/icon/icon.spec.ts b/src/lib/icon/icon.spec.ts index 156cd20408fc..ec94136d117f 100644 --- a/src/lib/icon/icon.spec.ts +++ b/src/lib/icon/icon.spec.ts @@ -3,7 +3,7 @@ import {SafeResourceUrl, DomSanitizer} from '@angular/platform-browser'; import {XHRBackend} from '@angular/http'; import {MockBackend} from '@angular/http/testing'; import {Component} from '@angular/core'; -import {MdIconModule} from './icon'; +import {MdIconModule} from './index'; import {MdIconRegistry} from './icon-registry'; import {getFakeSvgHttpResponse} from './fake-svgs'; diff --git a/src/lib/icon/icon.ts b/src/lib/icon/icon.ts index d5922050f5a7..d9e0e038ca6d 100644 --- a/src/lib/icon/icon.ts +++ b/src/lib/icon/icon.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, ChangeDetectionStrategy, Component, ElementRef, @@ -14,11 +12,10 @@ import { Optional, SkipSelf, } from '@angular/core'; -import {HttpModule, Http} from '@angular/http'; +import {Http} from '@angular/http'; import {DomSanitizer} from '@angular/platform-browser'; -import {MdError, CompatibilityModule} from '../core'; +import {MdError} from '../core'; import {MdIconRegistry, MdIconNameNotFoundError} from './icon-registry'; -export {MdIconRegistry} from './icon-registry'; /** Exception thrown when an invalid icon name is passed to an md-icon component. */ export class MdIconInvalidNameError extends MdError { @@ -261,19 +258,3 @@ export const ICON_REGISTRY_PROVIDER = { deps: [[new Optional(), new SkipSelf(), MdIconRegistry], Http, DomSanitizer], useFactory: ICON_REGISTRY_PROVIDER_FACTORY, }; - -@NgModule({ - imports: [HttpModule, CompatibilityModule], - exports: [MdIcon, CompatibilityModule], - declarations: [MdIcon], - providers: [ICON_REGISTRY_PROVIDER], -}) -export class MdIconModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdIconModule, - providers: [], - }; - } -} diff --git a/src/lib/icon/index.ts b/src/lib/icon/index.ts index af77d84efccf..c2b2f7bcba31 100644 --- a/src/lib/icon/index.ts +++ b/src/lib/icon/index.ts @@ -1 +1,25 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {HttpModule} from '@angular/http'; +import {CompatibilityModule} from '../core'; +import {MdIcon, ICON_REGISTRY_PROVIDER} from './icon'; + + +@NgModule({ + imports: [HttpModule, CompatibilityModule], + exports: [MdIcon, CompatibilityModule], + declarations: [MdIcon], + providers: [ICON_REGISTRY_PROVIDER], +}) +export class MdIconModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdIconModule, + providers: [], + }; + } +} + + export * from './icon'; +export {MdIconRegistry} from './icon-registry'; diff --git a/src/lib/input/index.ts b/src/lib/input/index.ts index db45cf0dde0e..d0a7d8a6532f 100644 --- a/src/lib/input/index.ts +++ b/src/lib/input/index.ts @@ -6,11 +6,6 @@ import {FormsModule} from '@angular/forms'; import {PlatformModule} from '../core/platform/index'; -export * from './autosize' -export * from './input-container'; -export * from './input-container-errors'; - - @NgModule({ declarations: [ MdPlaceholder, @@ -41,3 +36,9 @@ export class MdInputModule { }; } } + + +export * from './autosize' +export * from './input-container'; +export * from './input-container-errors'; + diff --git a/src/lib/list/index.ts b/src/lib/list/index.ts index 71825137f468..78100824d63f 100644 --- a/src/lib/list/index.ts +++ b/src/lib/list/index.ts @@ -1 +1,54 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {MdLineModule, CompatibilityModule} from '../core'; +import { + MdList, + MdListItem, + MdListDivider, + MdListAvatarCssMatStyler, + MdListIconCssMatStyler, + MdListCssMatStyler, + MdNavListCssMatStyler, + MdDividerCssMatStyler, + MdListSubheaderCssMatStyler, +} from './list'; + + +@NgModule({ + imports: [MdLineModule, CompatibilityModule], + exports: [ + MdList, + MdListItem, + MdListDivider, + MdListAvatarCssMatStyler, + MdLineModule, + CompatibilityModule, + MdListIconCssMatStyler, + MdListCssMatStyler, + MdNavListCssMatStyler, + MdDividerCssMatStyler, + MdListSubheaderCssMatStyler + ], + declarations: [ + MdList, + MdListItem, + MdListDivider, + MdListAvatarCssMatStyler, + MdListIconCssMatStyler, + MdListCssMatStyler, + MdNavListCssMatStyler, + MdDividerCssMatStyler, + MdListSubheaderCssMatStyler + ], +}) +export class MdListModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdListModule, + providers: [] + }; + } +} + + export * from './list'; diff --git a/src/lib/list/list.spec.ts b/src/lib/list/list.spec.ts index c4f1c43c6331..db1937370472 100644 --- a/src/lib/list/list.spec.ts +++ b/src/lib/list/list.spec.ts @@ -1,7 +1,7 @@ import {async, TestBed} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdListItem, MdListModule} from './list'; +import {MdListItem, MdListModule} from './index'; describe('MdList', () => { diff --git a/src/lib/list/list.ts b/src/lib/list/list.ts index a6a675065367..7a2c2c6929d5 100644 --- a/src/lib/list/list.ts +++ b/src/lib/list/list.ts @@ -1,17 +1,15 @@ import { - Component, - ViewEncapsulation, - ContentChildren, - ContentChild, - QueryList, - Directive, - ElementRef, - Renderer, - AfterContentInit, - NgModule, - ModuleWithProviders, + Component, + ViewEncapsulation, + ContentChildren, + ContentChild, + QueryList, + Directive, + ElementRef, + Renderer, + AfterContentInit, } from '@angular/core'; -import {MdLine, MdLineSetter, MdLineModule, CompatibilityModule} from '../core'; +import {MdLine, MdLineSetter} from '../core'; @Directive({ selector: 'md-divider, mat-divider' @@ -130,41 +128,3 @@ export class MdListItem implements AfterContentInit { this._hasFocus = false; } } - - -@NgModule({ - imports: [MdLineModule, CompatibilityModule], - exports: [ - MdList, - MdListItem, - MdListDivider, - MdListAvatarCssMatStyler, - MdLineModule, - CompatibilityModule, - MdListIconCssMatStyler, - MdListCssMatStyler, - MdNavListCssMatStyler, - MdDividerCssMatStyler, - MdListSubheaderCssMatStyler - ], - declarations: [ - MdList, - MdListItem, - MdListDivider, - MdListAvatarCssMatStyler, - MdListIconCssMatStyler, - MdListCssMatStyler, - MdNavListCssMatStyler, - MdDividerCssMatStyler, - MdListSubheaderCssMatStyler - ], -}) -export class MdListModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdListModule, - providers: [] - }; - } -} diff --git a/src/lib/menu/index.ts b/src/lib/menu/index.ts index e85efa8bca0a..87b541aca49e 100644 --- a/src/lib/menu/index.ts +++ b/src/lib/menu/index.ts @@ -1,3 +1,28 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {OverlayModule, CompatibilityModule} from '../core'; +import {MdMenu} from './menu-directive'; +import {MdMenuItem} from './menu-item'; +import {MdMenuTrigger} from './menu-trigger'; +import {MdRippleModule} from '../core/ripple/index'; + + +@NgModule({ + imports: [OverlayModule, CommonModule, MdRippleModule, CompatibilityModule], + exports: [MdMenu, MdMenuItem, MdMenuTrigger, CompatibilityModule], + declarations: [MdMenu, MdMenuItem, MdMenuTrigger], +}) +export class MdMenuModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdMenuModule, + providers: [], + }; + } +} + + export * from './menu'; export {MdMenuTrigger} from './menu-trigger'; export {fadeInItems, transformMenu} from './menu-animations'; diff --git a/src/lib/menu/menu.spec.ts b/src/lib/menu/menu.spec.ts index fbf23d4bed85..1ccdbc698d3a 100644 --- a/src/lib/menu/menu.spec.ts +++ b/src/lib/menu/menu.spec.ts @@ -15,7 +15,7 @@ import { MdMenuPanel, MenuPositionX, MenuPositionY -} from './menu'; +} from './index'; import {OverlayContainer} from '../core/overlay/overlay-container'; import {ViewportRuler} from '../core/overlay/position/viewport-ruler'; import {Dir, LayoutDirection} from '../core/rtl/dir'; diff --git a/src/lib/menu/menu.ts b/src/lib/menu/menu.ts index 262ca5e7623e..d5041a9068f7 100644 --- a/src/lib/menu/menu.ts +++ b/src/lib/menu/menu.ts @@ -1,28 +1,5 @@ -import {NgModule, ModuleWithProviders} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {OverlayModule, CompatibilityModule} from '../core'; -import {MdMenu} from './menu-directive'; -import {MdMenuItem} from './menu-item'; -import {MdMenuTrigger} from './menu-trigger'; -import {MdRippleModule} from '../core/ripple/index'; export {MdMenu} from './menu-directive'; export {MdMenuItem} from './menu-item'; export {MdMenuTrigger} from './menu-trigger'; export {MdMenuPanel} from './menu-panel'; export {MenuPositionX, MenuPositionY} from './menu-positions'; - - -@NgModule({ - imports: [OverlayModule, CommonModule, MdRippleModule, CompatibilityModule], - exports: [MdMenu, MdMenuItem, MdMenuTrigger, CompatibilityModule], - declarations: [MdMenu, MdMenuItem, MdMenuTrigger], -}) -export class MdMenuModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdMenuModule, - providers: [], - }; - } -} diff --git a/src/lib/progress-bar/index.ts b/src/lib/progress-bar/index.ts index d71d9b1bf740..89730762bd34 100644 --- a/src/lib/progress-bar/index.ts +++ b/src/lib/progress-bar/index.ts @@ -1 +1,23 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {CompatibilityModule} from '../core/compatibility/compatibility'; +import {MdProgressBar} from './progress-bar'; + + +@NgModule({ + imports: [CommonModule, CompatibilityModule], + exports: [MdProgressBar, CompatibilityModule], + declarations: [MdProgressBar], +}) +export class MdProgressBarModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdProgressBarModule, + providers: [] + }; + } +} + + export * from './progress-bar'; diff --git a/src/lib/progress-bar/progress-bar.spec.ts b/src/lib/progress-bar/progress-bar.spec.ts index 264977087de9..d071e0fee566 100644 --- a/src/lib/progress-bar/progress-bar.spec.ts +++ b/src/lib/progress-bar/progress-bar.spec.ts @@ -1,7 +1,7 @@ import {TestBed, async, ComponentFixture} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdProgressBarModule} from './progress-bar'; +import {MdProgressBarModule} from './index'; describe('MdProgressBar', () => { diff --git a/src/lib/progress-bar/progress-bar.ts b/src/lib/progress-bar/progress-bar.ts index 38d67f0c2975..a5dc0184b1e9 100644 --- a/src/lib/progress-bar/progress-bar.ts +++ b/src/lib/progress-bar/progress-bar.ts @@ -1,13 +1,9 @@ import { - NgModule, - ModuleWithProviders, - Component, - ChangeDetectionStrategy, - HostBinding, - Input, + Component, + ChangeDetectionStrategy, + HostBinding, + Input, } from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {CompatibilityModule} from '../core/compatibility/compatibility'; // TODO(josephperrott): Benchpress tests. // TODO(josephperrott): Add ARIA attributes for progressbar "for". @@ -84,19 +80,3 @@ export class MdProgressBar { function clamp(v: number, min = 0, max = 100) { return Math.max(min, Math.min(max, v)); } - - -@NgModule({ - imports: [CommonModule, CompatibilityModule], - exports: [MdProgressBar, CompatibilityModule], - declarations: [MdProgressBar], -}) -export class MdProgressBarModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdProgressBarModule, - providers: [] - }; - } -} diff --git a/src/lib/progress-spinner/index.ts b/src/lib/progress-spinner/index.ts index 03eb3d7fcc76..113dc6f84d66 100644 --- a/src/lib/progress-spinner/index.ts +++ b/src/lib/progress-spinner/index.ts @@ -1,2 +1,42 @@ -export * from './progress-circle'; +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CompatibilityModule} from '../core'; +import { + MdProgressSpinner, + MdSpinner, + MdProgressSpinnerCssMatStyler, + MdProgressCircleCssMatStyler +} from './progress-spinner'; + + +@NgModule({ + imports: [CompatibilityModule], + exports: [ + MdProgressSpinner, + MdSpinner, + CompatibilityModule, + MdProgressSpinnerCssMatStyler, + MdProgressCircleCssMatStyler + ], + declarations: [ + MdProgressSpinner, + MdSpinner, + MdProgressSpinnerCssMatStyler, + MdProgressCircleCssMatStyler + ], +}) +class MdProgressSpinnerModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdProgressSpinnerModule, + providers: [] + }; + } +} + +export {MdProgressSpinnerModule}; export * from './progress-spinner'; + +/** @deprecated */ +export {MdProgressSpinnerModule as MdProgressCircleModule}; +export {MdProgressSpinner as MdProgressCircle}; diff --git a/src/lib/progress-spinner/progress-circle.ts b/src/lib/progress-spinner/progress-circle.ts deleted file mode 100644 index 4b8d8bb0d906..000000000000 --- a/src/lib/progress-spinner/progress-circle.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** @deprecated */ -export {MdProgressSpinner as MdProgressCircle} from './progress-spinner'; -/** @deprecated */ -export {MdProgressSpinnerModule as MdProgressCircleModule} from './progress-spinner'; diff --git a/src/lib/progress-spinner/progress-spinner.spec.ts b/src/lib/progress-spinner/progress-spinner.spec.ts index 7153eebfb5fe..0db59707ec16 100644 --- a/src/lib/progress-spinner/progress-spinner.spec.ts +++ b/src/lib/progress-spinner/progress-spinner.spec.ts @@ -1,7 +1,7 @@ import {TestBed, async} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdProgressSpinnerModule} from './progress-spinner'; +import {MdProgressSpinnerModule} from './index'; describe('MdProgressSpinner', () => { diff --git a/src/lib/progress-spinner/progress-spinner.ts b/src/lib/progress-spinner/progress-spinner.ts index 2ebdeb8d3c06..1f56143478f0 100644 --- a/src/lib/progress-spinner/progress-spinner.ts +++ b/src/lib/progress-spinner/progress-spinner.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, Component, HostBinding, ChangeDetectionStrategy, @@ -10,7 +8,6 @@ import { NgZone, Renderer, Directive } from '@angular/core'; -import {CompatibilityModule} from '../core'; // TODO(josephperrott): Benchpress tests. @@ -382,30 +379,3 @@ function getSvgArc(currentValue: number, rotation: number) { return `M${start}A${pathRadius},${pathRadius} 0 ${largeArcFlag},${arcSweep} ${end}`; } - - -@NgModule({ - imports: [CompatibilityModule], - exports: [ - MdProgressSpinner, - MdSpinner, - CompatibilityModule, - MdProgressSpinnerCssMatStyler, - MdProgressCircleCssMatStyler - ], - declarations: [ - MdProgressSpinner, - MdSpinner, - MdProgressSpinnerCssMatStyler, - MdProgressCircleCssMatStyler - ], -}) -export class MdProgressSpinnerModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdProgressSpinnerModule, - providers: [] - }; - } -} diff --git a/src/lib/radio/index.ts b/src/lib/radio/index.ts index 1140e08e216f..586a2734c855 100644 --- a/src/lib/radio/index.ts +++ b/src/lib/radio/index.ts @@ -1 +1,30 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {VIEWPORT_RULER_PROVIDER} from '../core/overlay/position/viewport-ruler'; +import { + MdRippleModule, + CompatibilityModule, + UNIQUE_SELECTION_DISPATCHER_PROVIDER, + FocusOriginMonitor, +} from '../core'; +import {MdRadioGroup, MdRadioButton} from './radio'; + + +@NgModule({ + imports: [CommonModule, MdRippleModule, CompatibilityModule], + exports: [MdRadioGroup, MdRadioButton, CompatibilityModule], + providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, VIEWPORT_RULER_PROVIDER, FocusOriginMonitor], + declarations: [MdRadioGroup, MdRadioButton], +}) +export class MdRadioModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdRadioModule, + providers: [], + }; + } +} + + export * from './radio'; diff --git a/src/lib/radio/radio.spec.ts b/src/lib/radio/radio.spec.ts index eaccd2ca4099..238949c9488a 100644 --- a/src/lib/radio/radio.spec.ts +++ b/src/lib/radio/radio.spec.ts @@ -2,7 +2,7 @@ import {async, ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/t import {NgControl, FormsModule, ReactiveFormsModule, FormControl} from '@angular/forms'; import {Component, DebugElement} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdRadioGroup, MdRadioButton, MdRadioChange, MdRadioModule} from './radio'; +import {MdRadioGroup, MdRadioButton, MdRadioChange, MdRadioModule} from './index'; import {ViewportRuler} from '../core/overlay/position/viewport-ruler'; import {FakeViewportRuler} from '../core/overlay/position/fake-viewport-ruler'; import {dispatchFakeEvent} from '../core/testing/dispatch-events'; diff --git a/src/lib/radio/radio.ts b/src/lib/radio/radio.ts index 1ccc01990fd8..9bf104b21af1 100644 --- a/src/lib/radio/radio.ts +++ b/src/lib/radio/radio.ts @@ -13,25 +13,18 @@ import { QueryList, ViewEncapsulation, forwardRef, - NgModule, - ModuleWithProviders, ViewChild, OnDestroy, AfterViewInit, } from '@angular/core'; -import {CommonModule} from '@angular/common'; import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; import { - MdRippleModule, RippleRef, UniqueSelectionDispatcher, - CompatibilityModule, - UNIQUE_SELECTION_DISPATCHER_PROVIDER, MdRipple, FocusOriginMonitor, } from '../core'; import {coerceBooleanProperty} from '../core/coercion/boolean-property'; -import {VIEWPORT_RULER_PROVIDER} from '../core/overlay/position/viewport-ruler'; import {Subscription} from 'rxjs/Subscription'; @@ -527,20 +520,3 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy { } } - - -@NgModule({ - imports: [CommonModule, MdRippleModule, CompatibilityModule], - exports: [MdRadioGroup, MdRadioButton, CompatibilityModule], - providers: [UNIQUE_SELECTION_DISPATCHER_PROVIDER, VIEWPORT_RULER_PROVIDER, FocusOriginMonitor], - declarations: [MdRadioGroup, MdRadioButton], -}) -export class MdRadioModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdRadioModule, - providers: [], - }; - } -} diff --git a/src/lib/select/index.ts b/src/lib/select/index.ts index 1a2e4afe6a88..c1e58f3ed157 100644 --- a/src/lib/select/index.ts +++ b/src/lib/select/index.ts @@ -6,8 +6,6 @@ import { CompatibilityModule, OverlayModule, } from '../core'; -export * from './select'; -export {fadeInContent, transformPanel, transformPlaceholder} from './select-animations'; @NgModule({ @@ -24,3 +22,7 @@ export class MdSelectModule { }; } } + + +export * from './select'; +export {fadeInContent, transformPanel, transformPlaceholder} from './select-animations'; diff --git a/src/lib/sidenav/index.ts b/src/lib/sidenav/index.ts index b126f2c842e3..cd2f2a879f1a 100644 --- a/src/lib/sidenav/index.ts +++ b/src/lib/sidenav/index.ts @@ -1 +1,25 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {CompatibilityModule} from '../core'; +import {A11yModule} from '../core/a11y/index'; +import {OverlayModule} from '../core/overlay/overlay-directives'; +import {MdSidenav, MdSidenavContainer} from './sidenav'; + + +@NgModule({ + imports: [CommonModule, CompatibilityModule, A11yModule, OverlayModule], + exports: [MdSidenavContainer, MdSidenav, CompatibilityModule], + declarations: [MdSidenavContainer, MdSidenav], +}) +export class MdSidenavModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdSidenavModule, + providers: [] + }; + } +} + + export * from './sidenav'; diff --git a/src/lib/sidenav/sidenav.spec.ts b/src/lib/sidenav/sidenav.spec.ts index 31a59669134e..073a3f5378b5 100644 --- a/src/lib/sidenav/sidenav.spec.ts +++ b/src/lib/sidenav/sidenav.spec.ts @@ -1,7 +1,7 @@ import {fakeAsync, async, tick, ComponentFixture, TestBed} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; -import {MdSidenav, MdSidenavModule, MdSidenavToggleResult} from './sidenav'; +import {MdSidenav, MdSidenavModule, MdSidenavToggleResult} from './index'; import {A11yModule} from '../core/a11y/index'; import {PlatformModule} from '../core/platform/index'; import {ESCAPE} from '../core/keyboard/keycodes'; diff --git a/src/lib/sidenav/sidenav.ts b/src/lib/sidenav/sidenav.ts index c81e797d9224..b86b0c156d82 100644 --- a/src/lib/sidenav/sidenav.ts +++ b/src/lib/sidenav/sidenav.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, AfterContentInit, Component, ContentChildren, @@ -16,12 +14,9 @@ import { NgZone, OnDestroy, } from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {Dir, MdError, coerceBooleanProperty, CompatibilityModule} from '../core'; -import {A11yModule} from '../core/a11y/index'; +import {Dir, MdError, coerceBooleanProperty} from '../core'; import {FocusTrapFactory, FocusTrap} from '../core/a11y/focus-trap'; import {ESCAPE} from '../core/keyboard/keycodes'; -import {OverlayModule} from '../core/overlay/overlay-directives'; import 'rxjs/add/operator/first'; @@ -507,19 +502,3 @@ export class MdSidenavContainer implements AfterContentInit { }; } } - - -@NgModule({ - imports: [CommonModule, CompatibilityModule, A11yModule, OverlayModule], - exports: [MdSidenavContainer, MdSidenav, CompatibilityModule], - declarations: [MdSidenavContainer, MdSidenav], -}) -export class MdSidenavModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdSidenavModule, - providers: [] - }; - } -} diff --git a/src/lib/slide-toggle/index.ts b/src/lib/slide-toggle/index.ts index e2f2f602f25c..2c7409e1c60d 100644 --- a/src/lib/slide-toggle/index.ts +++ b/src/lib/slide-toggle/index.ts @@ -1 +1,26 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {FormsModule} from '@angular/forms'; +import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; +import {GestureConfig, CompatibilityModule} from '../core'; +import {MdSlideToggle} from './slide-toggle'; +import {MdRippleModule} from '../core/ripple/index'; + + +@NgModule({ + imports: [FormsModule, MdRippleModule, CompatibilityModule], + exports: [MdSlideToggle, CompatibilityModule], + declarations: [MdSlideToggle], + providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}], +}) +export class MdSlideToggleModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdSlideToggleModule, + providers: [] + }; + } +} + + export * from './slide-toggle'; diff --git a/src/lib/slide-toggle/slide-toggle.spec.ts b/src/lib/slide-toggle/slide-toggle.spec.ts index 2d2441909dbf..92d851c950f5 100644 --- a/src/lib/slide-toggle/slide-toggle.spec.ts +++ b/src/lib/slide-toggle/slide-toggle.spec.ts @@ -1,8 +1,8 @@ -import {async, ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing'; -import {By, HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; import {Component} from '@angular/core'; -import {MdSlideToggle, MdSlideToggleChange, MdSlideToggleModule} from './slide-toggle'; +import {By, HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; +import {async, ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing'; import {FormsModule, NgControl, ReactiveFormsModule, FormControl} from '@angular/forms'; +import {MdSlideToggle, MdSlideToggleChange, MdSlideToggleModule} from './index'; import {TestGestureConfig} from '../slider/test-gesture-config'; import {dispatchFakeEvent} from '../core/testing/dispatch-events'; diff --git a/src/lib/slide-toggle/slide-toggle.ts b/src/lib/slide-toggle/slide-toggle.ts index 2cc0edde5064..ab4a5de00d66 100644 --- a/src/lib/slide-toggle/slide-toggle.ts +++ b/src/lib/slide-toggle/slide-toggle.ts @@ -8,22 +8,12 @@ import { Output, EventEmitter, AfterContentInit, - NgModule, - ModuleWithProviders, ViewChild, ViewEncapsulation, } from '@angular/core'; -import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; -import {FormsModule, ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; -import { - applyCssTransform, - coerceBooleanProperty, - GestureConfig, - HammerInput, - CompatibilityModule, -} from '../core'; +import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; +import {applyCssTransform, coerceBooleanProperty, HammerInput} from '../core'; import {Observable} from 'rxjs/Observable'; -import {MdRippleModule} from '../core/ripple/index'; export const MD_SLIDE_TOGGLE_VALUE_ACCESSOR: any = { @@ -352,20 +342,3 @@ class SlideToggleRenderer { } } - - -@NgModule({ - imports: [FormsModule, MdRippleModule, CompatibilityModule], - exports: [MdSlideToggle, CompatibilityModule], - declarations: [MdSlideToggle], - providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}], -}) -export class MdSlideToggleModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdSlideToggleModule, - providers: [] - }; - } -} diff --git a/src/lib/slider/index.ts b/src/lib/slider/index.ts index eb0742f8019b..a37d19c4c8cf 100644 --- a/src/lib/slider/index.ts +++ b/src/lib/slider/index.ts @@ -1 +1,26 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {GestureConfig, CompatibilityModule} from '../core'; +import {MdSlider} from './slider'; + + +@NgModule({ + imports: [CommonModule, FormsModule, CompatibilityModule], + exports: [MdSlider, CompatibilityModule], + declarations: [MdSlider], + providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}] +}) +export class MdSliderModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdSliderModule, + providers: [] + }; + } +} + + export * from './slider'; diff --git a/src/lib/slider/slider.spec.ts b/src/lib/slider/slider.spec.ts index e029442694db..35ce2babed86 100644 --- a/src/lib/slider/slider.spec.ts +++ b/src/lib/slider/slider.spec.ts @@ -2,7 +2,7 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing'; import {ReactiveFormsModule, FormControl, FormsModule} from '@angular/forms'; import {Component, DebugElement} from '@angular/core'; import {By, HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; -import {MdSlider, MdSliderModule} from './slider'; +import {MdSlider, MdSliderModule} from './index'; import {TestGestureConfig} from './test-gesture-config'; import {RtlModule} from '../core/rtl/dir'; import { diff --git a/src/lib/slider/slider.ts b/src/lib/slider/slider.ts index c6158f55c477..758a4ffd5ba1 100644 --- a/src/lib/slider/slider.ts +++ b/src/lib/slider/slider.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, Component, ElementRef, Input, @@ -10,17 +8,9 @@ import { EventEmitter, Optional } from '@angular/core'; -import {NG_VALUE_ACCESSOR, ControlValueAccessor, FormsModule} from '@angular/forms'; -import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'; -import { - GestureConfig, - HammerInput, - coerceBooleanProperty, - coerceNumberProperty, - CompatibilityModule, -} from '../core'; +import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; +import {HammerInput, coerceBooleanProperty, coerceNumberProperty} from '../core'; import {Dir} from '../core/rtl/dir'; -import {CommonModule} from '@angular/common'; import { PAGE_UP, PAGE_DOWN, @@ -652,20 +642,3 @@ export class SliderRenderer { this._sliderElement.focus(); } } - - -@NgModule({ - imports: [CommonModule, FormsModule, CompatibilityModule], - exports: [MdSlider, CompatibilityModule], - declarations: [MdSlider], - providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}] -}) -export class MdSliderModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdSliderModule, - providers: [] - }; - } -} diff --git a/src/lib/snack-bar/index.ts b/src/lib/snack-bar/index.ts index 2425ecce98e9..99dfe54532c1 100644 --- a/src/lib/snack-bar/index.ts +++ b/src/lib/snack-bar/index.ts @@ -5,6 +5,7 @@ import {MdSnackBar} from './snack-bar'; import {MdSnackBarContainer} from './snack-bar-container'; import {SimpleSnackBar} from './simple-snack-bar'; + @NgModule({ imports: [OverlayModule, PortalModule, CommonModule, CompatibilityModule], exports: [MdSnackBarContainer, CompatibilityModule], @@ -22,6 +23,7 @@ export class MdSnackBarModule { } } + export * from './snack-bar'; export * from './snack-bar-container'; export * from './snack-bar-config'; diff --git a/src/lib/tabs/index.ts b/src/lib/tabs/index.ts index 47c6cb9c3587..51dcf3760728 100644 --- a/src/lib/tabs/index.ts +++ b/src/lib/tabs/index.ts @@ -1,3 +1,39 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {PortalModule} from '../core'; +import {MdRippleModule} from '../core/ripple/index'; +import {ObserveContentModule} from '../core/observe-content/observe-content'; +import {MdTab} from './tab'; +import {MdTabGroup} from './tab-group'; +import {MdTabLabel} from './tab-label'; +import {MdTabLabelWrapper} from './tab-label-wrapper'; +import {MdTabNavBar, MdTabLink, MdTabLinkRipple} from './tab-nav-bar/tab-nav-bar'; +import {MdInkBar} from './ink-bar'; +import {MdTabBody} from './tab-body'; +import {VIEWPORT_RULER_PROVIDER} from '../core/overlay/position/viewport-ruler'; +import {MdTabHeader} from './tab-header'; +import {SCROLL_DISPATCHER_PROVIDER} from '../core/overlay/scroll/scroll-dispatcher'; + + +@NgModule({ + imports: [CommonModule, PortalModule, MdRippleModule, ObserveContentModule], + // Don't export all components because some are only to be used internally. + exports: [MdTabGroup, MdTabLabel, MdTab, MdTabNavBar, MdTabLink, MdTabLinkRipple], + declarations: [MdTabGroup, MdTabLabel, MdTab, MdInkBar, MdTabLabelWrapper, + MdTabNavBar, MdTabLink, MdTabBody, MdTabLinkRipple, MdTabHeader], + providers: [VIEWPORT_RULER_PROVIDER, SCROLL_DISPATCHER_PROVIDER], +}) +export class MdTabsModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdTabsModule, + providers: [] + }; + } +} + + export * from './tab-group'; export {MdInkBar} from './ink-bar'; export {MdTabBody, MdTabBodyOriginState, MdTabBodyPositionState} from './tab-body'; diff --git a/src/lib/tabs/tab-group.spec.ts b/src/lib/tabs/tab-group.spec.ts index 661ed10d8e17..3ae944edcfc9 100644 --- a/src/lib/tabs/tab-group.spec.ts +++ b/src/lib/tabs/tab-group.spec.ts @@ -1,7 +1,7 @@ import { async, fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing'; -import {MdTabGroup, MdTabsModule, MdTabHeaderPosition} from './tab-group'; +import {MdTabGroup, MdTabsModule, MdTabHeaderPosition} from './index'; import {Component, ViewChild} from '@angular/core'; import {By} from '@angular/platform-browser'; import {Observable} from 'rxjs/Observable'; diff --git a/src/lib/tabs/tab-group.ts b/src/lib/tabs/tab-group.ts index 3b7b8d62d639..751767813409 100644 --- a/src/lib/tabs/tab-group.ts +++ b/src/lib/tabs/tab-group.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, ViewChild, Component, Input, @@ -11,24 +9,10 @@ import { ElementRef, Renderer } from '@angular/core'; -import {CommonModule} from '@angular/common'; -import { - PortalModule, - coerceBooleanProperty -} from '../core'; -import {MdTabLabel} from './tab-label'; -import {MdTabLabelWrapper} from './tab-label-wrapper'; -import {MdTabNavBar, MdTabLink, MdTabLinkRipple} from './tab-nav-bar/tab-nav-bar'; -import {MdInkBar} from './ink-bar'; +import {coerceBooleanProperty} from '../core'; import {Observable} from 'rxjs/Observable'; -import 'rxjs/add/operator/map'; -import {MdRippleModule} from '../core/ripple/index'; -import {ObserveContentModule} from '../core/observe-content/observe-content'; import {MdTab} from './tab'; -import {MdTabBody} from './tab-body'; -import {VIEWPORT_RULER_PROVIDER} from '../core/overlay/position/viewport-ruler'; -import {MdTabHeader} from './tab-header'; -import {SCROLL_DISPATCHER_PROVIDER} from '../core/overlay/scroll/scroll-dispatcher'; +import 'rxjs/add/operator/map'; /** Used to generate unique ID's for each tab component */ @@ -209,21 +193,3 @@ export class MdTabGroup { this._renderer.setElementStyle(this._tabBodyWrapper.nativeElement, 'height', ''); } } - -@NgModule({ - imports: [CommonModule, PortalModule, MdRippleModule, ObserveContentModule], - // Don't export all components because some are only to be used internally. - exports: [MdTabGroup, MdTabLabel, MdTab, MdTabNavBar, MdTabLink, MdTabLinkRipple], - declarations: [MdTabGroup, MdTabLabel, MdTab, MdInkBar, MdTabLabelWrapper, - MdTabNavBar, MdTabLink, MdTabBody, MdTabLinkRipple, MdTabHeader], - providers: [VIEWPORT_RULER_PROVIDER, SCROLL_DISPATCHER_PROVIDER], -}) -export class MdTabsModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdTabsModule, - providers: [] - }; - } -} diff --git a/src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts b/src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts index facdca13203a..54d98ad04de5 100644 --- a/src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts +++ b/src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts @@ -1,5 +1,5 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {MdTabsModule} from '../tab-group'; +import {MdTabsModule} from '../index'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; import {ViewportRuler} from '../../core/overlay/position/viewport-ruler'; diff --git a/src/lib/toolbar/index.ts b/src/lib/toolbar/index.ts index 316a52a324ed..ac40454a80ce 100644 --- a/src/lib/toolbar/index.ts +++ b/src/lib/toolbar/index.ts @@ -1 +1,22 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CompatibilityModule} from '../core'; +import {MdToolbar, MdToolbarRow} from './toolbar'; + + +@NgModule({ + imports: [CompatibilityModule], + exports: [MdToolbar, MdToolbarRow, CompatibilityModule], + declarations: [MdToolbar, MdToolbarRow], +}) +export class MdToolbarModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdToolbarModule, + providers: [] + }; + } +} + + export * from './toolbar'; diff --git a/src/lib/toolbar/toolbar.spec.ts b/src/lib/toolbar/toolbar.spec.ts index bb142afdd8e7..b688ae430c57 100644 --- a/src/lib/toolbar/toolbar.spec.ts +++ b/src/lib/toolbar/toolbar.spec.ts @@ -1,7 +1,7 @@ import {Component} from '@angular/core'; import {TestBed, async, ComponentFixture} from '@angular/core/testing'; import {By} from '@angular/platform-browser'; -import {MdToolbarModule} from './toolbar'; +import {MdToolbarModule} from './index'; describe('MdToolbar', () => { diff --git a/src/lib/toolbar/toolbar.ts b/src/lib/toolbar/toolbar.ts index 1b1212010b4d..49f6620437fb 100644 --- a/src/lib/toolbar/toolbar.ts +++ b/src/lib/toolbar/toolbar.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, Component, ChangeDetectionStrategy, Input, @@ -9,7 +7,6 @@ import { ElementRef, Renderer } from '@angular/core'; -import {CompatibilityModule} from '../core'; @Directive({ @@ -61,19 +58,3 @@ export class MdToolbar { } } - - -@NgModule({ - imports: [CompatibilityModule], - exports: [MdToolbar, MdToolbarRow, CompatibilityModule], - declarations: [MdToolbar, MdToolbarRow], -}) -export class MdToolbarModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdToolbarModule, - providers: [] - }; - } -} diff --git a/src/lib/tooltip/index.ts b/src/lib/tooltip/index.ts index ed8326d5e7c1..50d1e0df12dc 100644 --- a/src/lib/tooltip/index.ts +++ b/src/lib/tooltip/index.ts @@ -1 +1,24 @@ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {OverlayModule, CompatibilityModule} from '../core'; +import {PlatformModule} from '../core/platform/index'; +import {MdTooltip, TooltipComponent} from './tooltip'; + + +@NgModule({ + imports: [OverlayModule, CompatibilityModule, PlatformModule], + exports: [MdTooltip, TooltipComponent, CompatibilityModule], + declarations: [MdTooltip, TooltipComponent], + entryComponents: [TooltipComponent], +}) +export class MdTooltipModule { + /** @deprecated */ + static forRoot(): ModuleWithProviders { + return { + ngModule: MdTooltipModule, + providers: [] + }; + } +} + + export * from './tooltip'; diff --git a/src/lib/tooltip/tooltip.spec.ts b/src/lib/tooltip/tooltip.spec.ts index 81f4c0c9e816..f13af21eca89 100644 --- a/src/lib/tooltip/tooltip.spec.ts +++ b/src/lib/tooltip/tooltip.spec.ts @@ -14,7 +14,7 @@ import { ChangeDetectionStrategy } from '@angular/core'; import {By} from '@angular/platform-browser'; -import {TooltipPosition, MdTooltip, MdTooltipModule, SCROLL_THROTTLE_MS} from './tooltip'; +import {TooltipPosition, MdTooltip, MdTooltipModule, SCROLL_THROTTLE_MS} from './index'; import {OverlayContainer} from '../core'; import {Dir, LayoutDirection} from '../core/rtl/dir'; import {OverlayModule} from '../core/overlay/overlay-directives'; diff --git a/src/lib/tooltip/tooltip.ts b/src/lib/tooltip/tooltip.ts index fc621826beaf..65817c0aa6db 100644 --- a/src/lib/tooltip/tooltip.ts +++ b/src/lib/tooltip/tooltip.ts @@ -1,6 +1,4 @@ import { - NgModule, - ModuleWithProviders, Component, Directive, Input, @@ -22,18 +20,16 @@ import { import { Overlay, OverlayState, - OverlayModule, OverlayRef, ComponentPortal, OverlayConnectionPosition, OriginConnectionPosition, - CompatibilityModule } from '../core'; import {MdTooltipInvalidPositionError} from './tooltip-errors'; import {Observable} from 'rxjs/Observable'; import {Subject} from 'rxjs/Subject'; import {Dir} from '../core/rtl/dir'; -import {PlatformModule, Platform} from '../core/platform/index'; +import {Platform} from '../core/platform/index'; import 'rxjs/add/operator/first'; import {ScrollDispatcher} from '../core/overlay/scroll/scroll-dispatcher'; import {Subscription} from 'rxjs/Subscription'; @@ -445,20 +441,3 @@ export class TooltipComponent { } } } - - -@NgModule({ - imports: [OverlayModule, CompatibilityModule, PlatformModule], - exports: [MdTooltip, TooltipComponent, CompatibilityModule], - declarations: [MdTooltip, TooltipComponent], - entryComponents: [TooltipComponent], -}) -export class MdTooltipModule { - /** @deprecated */ - static forRoot(): ModuleWithProviders { - return { - ngModule: MdTooltipModule, - providers: [] - }; - } -}