Skip to content

Commit

Permalink
fix(module: popupservice): set popupservice providers in referenced c…
Browse files Browse the repository at this point in the history
…omponents. (#449)
  • Loading branch information
Guoyuanqiang authored and fisherspy committed May 21, 2019
1 parent 8e90387 commit a14ea6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion components/action-sheet/action-sheet.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { WhiteSpaceModule} from '../white-space/white-space.module';
import { LocaleProviderModule } from '../locale-provider/locale-provider.module';
import { PopupService } from '../core/services/popup.service';
import { ActionSheetService } from './action-sheet.service';
import { OverlayModule } from '@angular/cdk/overlay';

@NgModule({
imports: [CommonModule, NgZorroAntdMobilePipesModule, ListModule, WhiteSpaceModule, WingBlankModule, LocaleProviderModule],
imports: [CommonModule,OverlayModule, NgZorroAntdMobilePipesModule, ListModule, WhiteSpaceModule, WingBlankModule, LocaleProviderModule],
declarations: [
ActionSheetComponent
],
Expand Down
4 changes: 3 additions & 1 deletion components/core/services/popup.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Injectable, Injector, ComponentRef } from '@angular/core';
import { Overlay, OverlayConfig, OverlayRef, GlobalPositionStrategy } from '@angular/cdk/overlay';
import { ComponentPortal } from '@angular/cdk/portal';

@Injectable({
providedIn: 'root'
})
@Injectable()
export class PopupService {
static overlay: Overlay = null;
Expand Down
8 changes: 5 additions & 3 deletions components/modal/modal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { ButtonModule } from '../button/button.module';
import { InputItemModule } from '../input-item/input-item.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AlertOptions } from './modal-options.provider';

import { OverlayModule } from '@angular/cdk/overlay';
import { PopupService } from '../core/services/popup.service';
@NgModule({
imports: [
CommonModule,
Expand All @@ -19,11 +20,12 @@ import { AlertOptions } from './modal-options.provider';
ButtonModule,
InputItemModule,
FormsModule,
ReactiveFormsModule
ReactiveFormsModule,
OverlayModule
],
exports: [ModalComponent, ModalServiceComponent],
declarations: [ModalComponent, ModalServiceComponent],
entryComponents: [ModalServiceComponent],
providers: [AlertOptions, ModalService]
providers: [AlertOptions, ModalService, PopupService]
})
export class ModalModule {}
3 changes: 2 additions & 1 deletion components/picker/picker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { PickerDirective } from './picker.directive';
import { PickerOptions } from './picker-options.provider';
import { PopupService } from '../core/services/popup.service';
import { PickerService } from './picker.service';
import { OverlayModule } from '@angular/cdk/overlay';

@NgModule({
imports: [CommonModule],
imports: [CommonModule, OverlayModule],
exports: [PickerComponent, PickerDirective],
declarations: [PickerComponent, PickerDirective],
providers: [PickerOptions, PopupService, PickerService],
Expand Down

0 comments on commit a14ea6b

Please sign in to comment.