blob: 194d2e0095d3323fc0a6fe3d47fa2d396751b296 [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
2 * ============LICENSE_START=======================================================
3 * SDC
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
Idan Amit2c285722017-12-29 09:40:43 +020010 *
Michael Landodd603392017-07-12 00:54:52 +030011 * http://www.apache.org/licenses/LICENSE-2.0
Idan Amit2c285722017-12-29 09:40:43 +020012 *
Michael Landodd603392017-07-12 00:54:52 +030013 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
Michael Landoed64b5e2017-06-09 03:19:04 +030021import {BrowserModule} from '@angular/platform-browser';
22import {NgModule, APP_INITIALIZER} from '@angular/core';
23import {FormsModule} from '@angular/forms';
24import {forwardRef} from '@angular/core';
25import {AppComponent} from './app.component';
26import {UpgradeAdapter} from '@angular/upgrade';
27import {UpgradeModule} from '@angular/upgrade/static';
28import {PropertiesAssignmentModule} from './pages/properties-assignment/properties-assignment.module';
29import {
Tal Gitelman51d50f02017-12-10 18:55:03 +020030 DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory,
Michael Landoa5445102018-03-04 14:53:33 +020031 StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider, ScopeServiceFactory,
32 NotificationServiceProvider
Michael Landoed64b5e2017-06-09 03:19:04 +030033} from "./utils/ng1-upgraded-provider";
34import {ConfigService} from "./services/config.service";
Michael Landoed64b5e2017-06-09 03:19:04 +030035import {HttpModule} from '@angular/http';
Avi Zivf5854fd2017-07-31 15:50:46 +030036import {HttpService} from './services/http.service';
Michael Landoed64b5e2017-06-09 03:19:04 +030037import {AuthenticationService} from './services/authentication.service';
38import {Cookie2Service} from "./services/cookie.service";
39import {ComponentServiceNg2} from "./services/component-services/component.service";
Michael Landoa5445102018-03-04 14:53:33 +020040import {ComponentServiceFactoryNg2} from "./services/component-services/component.service.factory";
Michael Landoed64b5e2017-06-09 03:19:04 +030041import {ServiceServiceNg2} from "./services/component-services/service.service";
42import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service";
Tal Gitelman51d50f02017-12-10 18:55:03 +020043import {ModalService} from "./services/modal.service";
44import {UiElementsModule} from "./components/ui/ui-elements.module";
45import {ConnectionWizardModule} from "./pages/connection-wizard/connection-wizard.module";
Arielk802bd2a2018-04-16 15:37:39 +030046import {InterfaceOperationModule} from "./pages/interface-operation/interface-operation.module";
47import {OperationCreatorModule} from "./pages/interface-operation/operation-creator/operation-creator.module";
Tal Gitelman51d50f02017-12-10 18:55:03 +020048import {LayoutModule} from "./components/layout/layout.module";
49import {UserService} from "./services/user.service";
Michael Landoa5445102018-03-04 14:53:33 +020050import {PoliciesService} from "./services/policies.service";
51import {DynamicComponentService} from "./services/dynamic-component.service";
Tal Gitelman51d50f02017-12-10 18:55:03 +020052import {SdcConfig} from "./config/sdc-config.config";
53import { TranslateModule } from "./shared/translator/translate.module";
54import { TranslationServiceConfig } from "./config/translation.service.config";
Michael Landoa5445102018-03-04 14:53:33 +020055import {ServicePathCreatorModule} from './pages/service-path-creator/service-path-creator.module';
56import {ServicePathsListModule} from './pages/service-paths-list/service-paths-list.module';
Idan Amiteedaaf92018-01-31 13:27:33 +020057import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module";
58import {PluginsService} from "./services/plugins.service";
Idan Amit71904f22018-02-13 10:38:16 +020059import {EventBusService} from "./services/event-bus.service";
Michael Landoa5445102018-03-04 14:53:33 +020060import {ServicePathModule} from 'app/ng2/components/logic/service-path/service-path.module';
61import {ServicePathSelectorModule} from 'app/ng2/components/logic/service-path-selector/service-path-selector.module';
Michael Landoed64b5e2017-06-09 03:19:04 +030062
63export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
64
65export function configServiceFactory(config:ConfigService) {
Idan Amit2c285722017-12-29 09:40:43 +020066 return () => {
67 config.loadValidationConfiguration();
Idan Amiteedaaf92018-01-31 13:27:33 +020068 config.loadPluginsConfiguration();
Idan Amit2c285722017-12-29 09:40:43 +020069 }
Michael Landoed64b5e2017-06-09 03:19:04 +030070}
71
Michael Landoed64b5e2017-06-09 03:19:04 +030072
73@NgModule({
74 declarations: [
Tal Gitelman51d50f02017-12-10 18:55:03 +020075 AppComponent
Michael Landoed64b5e2017-06-09 03:19:04 +030076 ],
77 imports: [
78 BrowserModule,
79 UpgradeModule,
80 FormsModule,
81 HttpModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +020082 LayoutModule,
83 TranslateModule,
84 UiElementsModule,
85
86 //We need to import them here since we use them in angular1
87 ConnectionWizardModule,
Idan Amit5197c8b2018-01-15 14:31:42 +020088 PropertiesAssignmentModule,
Michael Landoa5445102018-03-04 14:53:33 +020089 PluginFrameModule,
Arielk802bd2a2018-04-16 15:37:39 +030090 InterfaceOperationModule,
91 OperationCreatorModule,
Michael Landoa5445102018-03-04 14:53:33 +020092 ServicePathCreatorModule,
93 ServicePathsListModule,
94 ServicePathModule,
95 ServicePathSelectorModule
Michael Landoed64b5e2017-06-09 03:19:04 +030096 ],
97 exports: [],
Tal Gitelman51d50f02017-12-10 18:55:03 +020098 entryComponents: [],
Michael Landoed64b5e2017-06-09 03:19:04 +030099 providers: [
Michael Landoed64b5e2017-06-09 03:19:04 +0300100 DataTypesServiceProvider,
101 SharingServiceProvider,
102 CookieServiceProvider,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200103 StateServiceFactory,
Michael Landoed64b5e2017-06-09 03:19:04 +0300104 StateParamsServiceFactory,
Michael Landoa5445102018-03-04 14:53:33 +0200105 ScopeServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +0300106 CacheServiceProvider,
107 EventListenerServiceProvider,
Michael Landoa5445102018-03-04 14:53:33 +0200108 NotificationServiceProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +0300109 AuthenticationService,
110 Cookie2Service,
111 ConfigService,
112 ComponentServiceNg2,
Michael Landoa5445102018-03-04 14:53:33 +0200113 ComponentServiceFactoryNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200114 ModalService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300115 ServiceServiceNg2,
Avi Zivf5854fd2017-07-31 15:50:46 +0300116 HttpService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200117 UserService,
Michael Landoa5445102018-03-04 14:53:33 +0200118 PoliciesService,
119 DynamicComponentService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200120 SdcConfig,
Michael Landoed64b5e2017-06-09 03:19:04 +0300121 ComponentInstanceServiceNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200122 TranslationServiceConfig,
Idan Amiteedaaf92018-01-31 13:27:33 +0200123 PluginsService,
Idan Amit71904f22018-02-13 10:38:16 +0200124 EventBusService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300125 {
126 provide: APP_INITIALIZER,
127 useFactory: configServiceFactory,
128 deps: [ConfigService],
129 multi: true
Tal Gitelmaned7e1c32017-06-29 19:30:00 +0300130 },
Michael Landoed64b5e2017-06-09 03:19:04 +0300131 ],
132 bootstrap: [AppComponent]
133})
134
135
136export class AppModule {
Michael Landoed64b5e2017-06-09 03:19:04 +0300137
Idan Amit71904f22018-02-13 10:38:16 +0200138 constructor(public upgrade:UpgradeModule, eventBusService:EventBusService) {
Michael Landoed64b5e2017-06-09 03:19:04 +0300139 }
140}