]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/common.module.ts
LP1821382 Angular boolean yes/no display component
[working/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, FormatValuePipe} from '@eg/core/format.service';
17 import {HatchService} from '@eg/share/print/hatch.service';
18 import {PrintService} from '@eg/share/print/print.service';
19
20 // Globally available components
21 import {PrintComponent} from '@eg/share/print/print.component';
22 import {DialogComponent} from '@eg/share/dialog/dialog.component';
23 import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
24 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
25 import {PromptDialogComponent} from '@eg/share/dialog/prompt.component';
26 import {ProgressInlineComponent} from '@eg/share/dialog/progress-inline.component';
27 import {ProgressDialogComponent} from '@eg/share/dialog/progress.component';
28 import {BoolDisplayComponent} from '@eg/share/util/bool.component';
29
30 @NgModule({
31   declarations: [
32     PrintComponent,
33     DialogComponent,
34     AlertDialogComponent,
35     ConfirmDialogComponent,
36     PromptDialogComponent,
37     ProgressInlineComponent,
38     ProgressDialogComponent,
39     BoolDisplayComponent,
40     FormatValuePipe
41   ],
42   imports: [
43     CommonModule,
44     FormsModule,
45     RouterModule,
46     NgbModule
47   ],
48   exports: [
49     CommonModule,
50     RouterModule,
51     NgbModule,
52     FormsModule,
53     PrintComponent,
54     DialogComponent,
55     AlertDialogComponent,
56     ConfirmDialogComponent,
57     PromptDialogComponent,
58     ProgressInlineComponent,
59     ProgressDialogComponent,
60     BoolDisplayComponent,
61     FormatValuePipe
62   ]
63 })
64
65 export class EgCommonModule {
66     /** forRoot() lets us define services that should only be
67      * instantiated once for all loaded routes */
68     static forRoot(): ModuleWithProviders {
69         return {
70             ngModule: EgCommonModule,
71             providers: [
72                 DatePipe,
73                 CurrencyPipe,
74                 HatchService,
75                 PrintService,
76                 FormatService
77             ]
78         };
79     }
80 }
81