/**
* Modules, services, and components used by all apps.
*/
-import {CommonModule, DatePipe, CurrencyPipe} from '@angular/common';
+import {CommonModule} from '@angular/common';
import {NgModule, ModuleWithProviders} from '@angular/core';
import {RouterModule} from '@angular/router';
import {FormsModule} from '@angular/forms';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
+import {EgCoreModule} from '@eg/core/core.module';
/*
Note core services are injected into 'root'.
*/
// consider moving these to core...
-import {FormatService, FormatValuePipe} from '@eg/core/format.service';
import {HatchService} from '@eg/share/print/hatch.service';
import {PrintService} from '@eg/share/print/print.service';
PromptDialogComponent,
ProgressInlineComponent,
ProgressDialogComponent,
- BoolDisplayComponent,
- FormatValuePipe
+ BoolDisplayComponent
],
imports: [
CommonModule,
FormsModule,
RouterModule,
- NgbModule
+ NgbModule,
+ EgCoreModule
],
exports: [
CommonModule,
RouterModule,
NgbModule,
FormsModule,
+ EgCoreModule,
PrintComponent,
DialogComponent,
AlertDialogComponent,
ProgressInlineComponent,
ProgressDialogComponent,
BoolDisplayComponent,
- FormatValuePipe
]
})
return {
ngModule: EgCommonModule,
providers: [
- DatePipe,
- CurrencyPipe,
HatchService,
- PrintService,
- FormatService
+ PrintService
]
};
}
--- /dev/null
+/**
+ * Core objects.
+ * Note that core services are generally defined with
+ * @Injectable({providedIn: 'root'}) so they are globally available
+ * and do not require entry in our 'providers' array.
+ */
+import {NgModule} from '@angular/core';
+import {CommonModule, DatePipe, CurrencyPipe} from '@angular/common';
+import {FormatService, FormatValuePipe} from './format.service';
+
+@NgModule({
+ declarations: [
+ FormatValuePipe
+ ],
+ imports: [
+ CommonModule
+ ],
+ exports: [
+ CommonModule,
+ FormatValuePipe
+ ],
+ providers: [
+ DatePipe,
+ CurrencyPipe
+ ]
+})
+
+export class EgCoreModule {}
+
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
+import {EgCoreModule} from '@eg/core/core.module';
import {ComboboxComponent} from '@eg/share/combobox/combobox.component';
import {ComboboxEntryComponent} from '@eg/share/combobox/combobox-entry.component';
import {DateSelectComponent} from '@eg/share/date-select/date-select.component';
imports: [
CommonModule,
FormsModule,
- NgbModule
+ NgbModule,
+ EgCoreModule
],
exports: [
CommonModule,
FormsModule,
NgbModule,
+ EgCoreModule,
ComboboxComponent,
ComboboxEntryComponent,
DateSelectComponent,