Skip to content

Commit

Permalink
fix(module:*): import PlatformModule when use platform in component (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nearzxh authored and hsuanxyz committed Jul 26, 2019
1 parent 915b67d commit 6ec85a4
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 39 deletions.
5 changes: 2 additions & 3 deletions components/affix/nz-affix.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core';

import { NzAffixComponent } from './nz-affix.component';

@NgModule({
declarations: [NzAffixComponent],
exports: [NzAffixComponent],
imports: [CommonModule],
imports: [CommonModule, PlatformModule],
providers: [SCROLL_SERVICE_PROVIDER]
})
export class NzAffixModule {}
5 changes: 2 additions & 3 deletions components/anchor/nz-anchor.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzAffixModule } from 'ng-zorro-antd/affix';
import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core';

Expand All @@ -18,7 +17,7 @@ import { NzAnchorComponent } from './nz-anchor.component';
@NgModule({
declarations: [NzAnchorComponent, NzAnchorLinkComponent],
exports: [NzAnchorComponent, NzAnchorLinkComponent],
imports: [CommonModule, NzAffixModule],
imports: [CommonModule, NzAffixModule, PlatformModule],
providers: [SCROLL_SERVICE_PROVIDER]
})
export class NzAnchorModule {}
4 changes: 2 additions & 2 deletions components/avatar/nz-avatar.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { NzIconModule } from 'ng-zorro-antd/icon';
Expand All @@ -15,6 +15,6 @@ import { NzAvatarComponent } from './nz-avatar.component';
@NgModule({
declarations: [NzAvatarComponent],
exports: [NzAvatarComponent],
imports: [CommonModule, NzIconModule]
imports: [CommonModule, NzIconModule, PlatformModule]
})
export class NzAvatarModule {}
5 changes: 2 additions & 3 deletions components/back-top/nz-back-top.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { SCROLL_SERVICE_PROVIDER } from 'ng-zorro-antd/core';

import { NzBackTopComponent } from './nz-back-top.component';

@NgModule({
declarations: [NzBackTopComponent],
exports: [NzBackTopComponent],
imports: [CommonModule],
imports: [CommonModule, PlatformModule],
providers: [SCROLL_SERVICE_PROVIDER]
})
export class NzBackTopModule {}
4 changes: 2 additions & 2 deletions components/carousel/nz-carousel.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

Expand All @@ -15,6 +15,6 @@ import { NzCarouselComponent } from './nz-carousel.component';
@NgModule({
declarations: [NzCarouselComponent, NzCarouselContentDirective],
exports: [NzCarouselComponent, NzCarouselContentDirective],
imports: [CommonModule]
imports: [CommonModule, PlatformModule]
})
export class NzCarouselModule {}
5 changes: 2 additions & 3 deletions components/descriptions/nz-descriptions.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzAddOnModule } from 'ng-zorro-antd/core';

import { NzDescriptionsItemComponent } from './nz-descriptions-item.component';
import { NzDescriptionsComponent } from './nz-descriptions.component';

@NgModule({
imports: [CommonModule, NzAddOnModule],
imports: [CommonModule, NzAddOnModule, PlatformModule],
declarations: [NzDescriptionsComponent, NzDescriptionsItemComponent],
exports: [NzDescriptionsComponent, NzDescriptionsItemComponent]
})
Expand Down
6 changes: 4 additions & 2 deletions components/icon/nz-icon.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { NgModule } from '@angular/core';

import { NzIconDirective } from './nz-icon.directive';

@NgModule({
exports: [NzIconDirective],
declarations: [NzIconDirective]
declarations: [NzIconDirective],
imports: [PlatformModule]
})
export class NzIconModule {}
14 changes: 11 additions & 3 deletions components/menu/nz-menu.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { OverlayModule } from '@angular/cdk/overlay';
import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzAddOnModule, NzNoAnimationModule } from 'ng-zorro-antd/core';
import { NzIconModule } from 'ng-zorro-antd/icon';
Expand All @@ -22,7 +21,16 @@ import { NzMenuDirective } from './nz-menu.directive';
import { NzSubMenuComponent } from './nz-submenu.component';

@NgModule({
imports: [CommonModule, FormsModule, NzButtonModule, OverlayModule, NzIconModule, NzNoAnimationModule, NzAddOnModule],
imports: [
CommonModule,
FormsModule,
PlatformModule,
NzButtonModule,
OverlayModule,
NzIconModule,
NzNoAnimationModule,
NzAddOnModule
],
declarations: [
NzMenuDirective,
NzMenuItemDirective,
Expand Down
4 changes: 2 additions & 2 deletions components/select/nz-select.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { OverlayModule } from '@angular/cdk/overlay';
import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzAddOnModule, NzNoAnimationModule, NzOverlayModule } from 'ng-zorro-antd/core';
import { NzEmptyModule } from 'ng-zorro-antd/empty';
import { NzI18nModule } from 'ng-zorro-antd/i18n';
Expand All @@ -30,6 +29,7 @@ import { NzSelectComponent } from './nz-select.component';
CommonModule,
NzI18nModule,
FormsModule,
PlatformModule,
OverlayModule,
NzIconModule,
NzAddOnModule,
Expand Down
5 changes: 2 additions & 3 deletions components/slider/nz-slider.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

import { NzSliderHandleComponent } from './nz-slider-handle.component';
Expand All @@ -32,6 +31,6 @@ import { NzSliderComponent } from './nz-slider.component';
NzSliderStepComponent,
NzSliderMarksComponent
],
imports: [CommonModule, NzToolTipModule]
imports: [CommonModule, PlatformModule, NzToolTipModule]
})
export class NzSliderModule {}
6 changes: 3 additions & 3 deletions components/statistic/nz-statistic.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzAddOnModule } from 'ng-zorro-antd/core';

import { NzCountdownComponent } from './nz-countdown.component';
import { NzStatisticNumberComponent } from './nz-statistic-number.component';
import { NzStatisticComponent } from './nz-statistic.component';
import { NzTimeRangePipe } from './nz-time-range.pipe';

@NgModule({
imports: [CommonModule, NzAddOnModule],
imports: [CommonModule, PlatformModule, NzAddOnModule],
declarations: [NzStatisticComponent, NzCountdownComponent, NzStatisticNumberComponent, NzTimeRangePipe],
exports: [NzStatisticComponent, NzCountdownComponent, NzStatisticNumberComponent, NzTimeRangePipe]
})
Expand Down
4 changes: 2 additions & 2 deletions components/table/nz-table.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzAddOnModule } from 'ng-zorro-antd/core';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
Expand Down Expand Up @@ -57,6 +56,7 @@ import { NzVirtualScrollDirective } from './nz-virtual-scroll.directive';
NzCheckboxModule,
NzDropDownModule,
CommonModule,
PlatformModule,
NzPaginationModule,
NzSpinModule,
NzI18nModule,
Expand Down
5 changes: 2 additions & 3 deletions components/timeline/nz-timeline.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzAddOnModule } from 'ng-zorro-antd/core';
import { NzIconModule } from 'ng-zorro-antd/icon';

Expand All @@ -18,6 +17,6 @@ import { NzTimelineComponent } from './nz-timeline.component';
@NgModule({
declarations: [NzTimelineItemComponent, NzTimelineComponent],
exports: [NzTimelineItemComponent, NzTimelineComponent],
imports: [CommonModule, NzIconModule, NzAddOnModule]
imports: [CommonModule, PlatformModule, NzIconModule, NzAddOnModule]
})
export class NzTimelineModule {}
4 changes: 2 additions & 2 deletions components/typography/nz-typography.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

Expand All @@ -29,7 +29,7 @@ import { NzTypographyComponent } from './nz-typography.component';
NzTransButtonModule,
NzCopyToClipboardServiceModule
],
exports: [NzTypographyComponent, NzTextCopyComponent, NzTextEditComponent],
exports: [NzTypographyComponent, NzTextCopyComponent, NzTextEditComponent, PlatformModule],
declarations: [NzTypographyComponent, NzTextCopyComponent, NzTextEditComponent]
})
export class NzTypographyModule {}
5 changes: 2 additions & 3 deletions components/upload/nz-upload.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzI18nModule } from 'ng-zorro-antd/i18n';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzProgressModule } from 'ng-zorro-antd/progress';
Expand All @@ -20,7 +19,7 @@ import { NzUploadListComponent } from './nz-upload-list.component';
import { NzUploadComponent } from './nz-upload.component';

@NgModule({
imports: [CommonModule, FormsModule, NzToolTipModule, NzProgressModule, NzI18nModule, NzIconModule],
imports: [CommonModule, FormsModule, PlatformModule, NzToolTipModule, NzProgressModule, NzI18nModule, NzIconModule],
declarations: [NzUploadComponent, NzUploadBtnComponent, NzUploadListComponent],
exports: [NzUploadComponent]
})
Expand Down

0 comments on commit 6ec85a4

Please sign in to comment.