import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader'; import { PositioningService } from 'ngx-bootstrap/positioning'; import { PopoverDirective } from './popover.directive'; import { PopoverContainerComponent } from './popover-container.component'; @NgModule({ imports: [CommonModule], declarations: [PopoverDirective, PopoverContainerComponent], exports: [PopoverDirective], entryComponents: [PopoverContainerComponent] }) export class PopoverModule { static forRoot(): ModuleWithProviders { return { ngModule: PopoverModule, providers: [ComponentLoaderFactory, PositioningService] }; } }