| /******************************************************************************** |
| * Copyright (c) 2015-2020 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| ********************************************************************************/ |
| |
| import { NgModule } from '@angular/core'; |
| import { CommonModule } from '@angular/common'; |
| import { HttpModule } from '@angular/http'; |
| import { HttpClientModule, HttpClient } from '@angular/common/http'; |
| import { FormsModule } from '@angular/forms'; |
| |
| import { ModalModule } from 'ngx-bootstrap'; |
| import { TypeaheadModule } from 'ngx-bootstrap'; |
| import { DatepickerModule } from 'ngx-bootstrap'; |
| import { AccordionModule } from 'ngx-bootstrap'; |
| import { TabsModule } from 'ngx-bootstrap/tabs'; |
| import { PositioningService } from 'ngx-bootstrap/positioning'; |
| import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader'; |
| import { BsDropdownModule } from 'ngx-bootstrap'; |
| |
| import { TreeModule, DataTableModule, SharedModule, ContextMenuModule } from 'primeng/primeng'; |
| import { GrowlModule, DropdownModule, MultiSelectModule, CalendarModule } from 'primeng/primeng'; |
| |
| import { PropertyService } from './property.service'; |
| import { PreferenceService } from './preference.service'; |
| |
| import { MDMNotificationComponent } from './mdm-notification.component'; |
| import { OverwriteDialogComponent } from './overwrite-dialog.component'; |
| |
| import { AttributeValuePipe } from '../navigator/attribute-value.pipe'; |
| |
| import { MDMDataSourceTranslationPipe } from '../localization/mdmdatasourcetranslation.pipe'; |
| |
| import { TranslateModule, TranslateService } from '@ngx-translate/core'; |
| |
| import { Observable } from 'rxjs/Observable'; |
| import { startWith, switchMap } from 'rxjs/operators'; |
| import { OnlyNumberDirective } from './only-number-directive'; |
| |
| // Marker function for ngx-translate-extract: |
| export function TRANSLATE(str: string) { |
| return str; |
| } |
| |
| export function streamTranslate(translateService: TranslateService, keys: string | Array<string>, params?: any): Observable<any> { |
| return translateService.onLangChange.pipe( startWith({}), |
| switchMap(() => params ? translateService.get(keys, params) : translateService.get(keys)) ); |
| } |
| |
| @NgModule({ |
| imports: [ |
| HttpModule, |
| FormsModule, |
| CommonModule, |
| ModalModule, |
| TabsModule.forRoot(), |
| TypeaheadModule.forRoot(), |
| DatepickerModule.forRoot(), |
| TreeModule, |
| DataTableModule, |
| SharedModule, |
| ContextMenuModule, |
| DropdownModule, |
| MultiSelectModule, |
| GrowlModule, |
| AccordionModule.forRoot(), |
| BsDropdownModule.forRoot(), |
| HttpClientModule, |
| TranslateModule.forChild(), |
| ], |
| declarations: [ |
| MDMNotificationComponent, |
| OverwriteDialogComponent, |
| MDMDataSourceTranslationPipe, |
| OnlyNumberDirective, |
| AttributeValuePipe |
| ], |
| exports: [ |
| CommonModule, |
| FormsModule, |
| ModalModule, |
| DropdownModule, |
| MultiSelectModule, |
| CalendarModule, |
| TreeModule, |
| DataTableModule, |
| SharedModule, |
| ContextMenuModule, |
| GrowlModule, |
| AccordionModule, |
| BsDropdownModule, |
| TypeaheadModule, |
| DatepickerModule, |
| MDMNotificationComponent, |
| OverwriteDialogComponent, |
| TranslateModule, |
| MDMDataSourceTranslationPipe, |
| AttributeValuePipe, |
| OnlyNumberDirective, |
| ], |
| providers: [ |
| PositioningService, |
| ComponentLoaderFactory, |
| PropertyService, |
| PreferenceService |
| ] |
| }) |
| export class MDMCoreModule { |
| |
| } |