LP1779158 Angular alert dialog component
[Evergreen.git] / Open-ILS / src / eg2 / src / app / common.module.ts
1 /**
2  * Modules, services, and components used by all apps.
3  */
4 import {CommonModule, DatePipe, CurrencyPipe} from '@angular/common';
5 import {NgModule, ModuleWithProviders} from '@angular/core';
6 import {RouterModule} from '@angular/router';
7 import {FormsModule} from '@angular/forms';
8 import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
9
10 /*
11 Note core services are injected into 'root'.
12 They do not have to be added to the providers list.
13 */
14
15 // consider moving these to core...
16 import {FormatService} from '@eg/core/format.service';
17 import {PrintService} from '@eg/share/print/print.service';
18
19 // Globally available components
20 import {PrintComponent} from '@eg/share/print/print.component';
21 import {DialogComponent} from '@eg/share/dialog/dialog.component';
22 import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
23 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
24 import {PromptDialogComponent} from '@eg/share/dialog/prompt.component';
25 import {ProgressInlineComponent} from '@eg/share/dialog/progress-inline.component';
26 import {ProgressDialogComponent} from '@eg/share/dialog/progress.component';
27
28 @NgModule({
29   declarations: [
30     PrintComponent,
31     DialogComponent,
32     AlertDialogComponent,
33     ConfirmDialogComponent,
34     PromptDialogComponent,
35     ProgressInlineComponent,
36     ProgressDialogComponent
37   ],
38   imports: [
39     CommonModule,
40     FormsModule,
41     RouterModule,
42     NgbModule
43   ],
44   exports: [
45     CommonModule,
46     RouterModule,
47     NgbModule,
48     FormsModule,
49     PrintComponent,
50     DialogComponent,
51     AlertDialogComponent,
52     ConfirmDialogComponent,
53     PromptDialogComponent,
54     ProgressInlineComponent,
55     ProgressDialogComponent
56   ]
57 })
58
59 export class EgCommonModule {
60     /** forRoot() lets us define services that should only be
61      * instantiated once for all loaded routes */
62     static forRoot(): ModuleWithProviders {
63         return {
64             ngModule: EgCommonModule,
65             providers: [
66                 DatePipe,
67                 CurrencyPipe,
68                 PrintService,
69                 FormatService
70             ]
71         };
72     }
73 }
74