import { ANALYZE_FOR_ENTRY_COMPONENTS , NgModule , ModuleWithProviders , Type } from '@angular/core' ; import { CommonModule } from '@angular/common' ; import { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser' ; import { DOMOutsideEventPlugin , DOMOverlayRenderer } from './providers/index' ; import { OverlayRenderer } from './models/tokens' ; import { CSSBackdrop , CSSDialogContainer } from './components/index' ; import { Overlay , ModalOverlay , OverlayDialogBoundary , OverlayTarget } from './overlay/index' ; @ NgModule ( { declarations : [ ModalOverlay , CSSBackdrop , CSSDialogContainer , OverlayDialogBoundary , OverlayTarget ] , imports : [ CommonModule ] , exports : [ CSSBackdrop , CSSDialogContainer , OverlayDialogBoundary , OverlayTarget ] , providers : [ Overlay ] , entryComponents : [ ModalOverlay , CSSBackdrop , CSSDialogContainer ] } ) export class ModalModule { param entryComponents static withComponents ( entryComponents ) { return { ngModule : ModalModule , providers : [ { provide : ANALYZE_FOR_ENTRY_COMPONENTS , useValue : entryComponents , multi : true } ] } ; } param entryComponents static forRoot ( entryComponents ? ) { return { ngModule : ModalModule , providers : [ { provide : OverlayRenderer , useClass : DOMOverlayRenderer } , { provide : EVENT_MANAGER_PLUGINS , useClass : DOMOutsideEventPlugin , multi : true } , { provide : ANALYZE_FOR_ENTRY_COMPONENTS , useValue : entryComponents || [ ] , multi : true } ] } ; } }