import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { DragDropModule } from '@angular/cdk/drag-drop'; const COMPONENTS = []; import { BottomSheetService } from './services/bottom-sheet.service'; import { ClipboardService } from './services/clipboard.service'; import { DialogService } from './services/dialog.service'; import { SnackBarService } from './services/snack-bar.service'; const SERVICES = [ BottomSheetService, ClipboardService, DialogService, SnackBarService ]; import { AlertDialogComponent } from './dialogs/alert.dialog.component'; import { ConfirmDialogComponent } from './dialogs/confirm.dialog.component'; const DIALOGS = [AlertDialogComponent, ConfirmDialogComponent]; import { ImagePipe } from './pipes/image.pipe'; const PIPES = [ImagePipe]; @NgModule({ imports: [ CommonModule, MatButtonModule, MatCardModule, MatDialogModule, MatSnackBarModule, DragDropModule ], exports: [...COMPONENTS, ...PIPES], declarations: [...COMPONENTS, ...DIALOGS, ...PIPES], entryComponents: [...DIALOGS] }) export class UCapUiModule { public static forRoot(): ModuleWithProviders { return { ngModule: UCapUiModule, providers: [...SERVICES] }; } }