blob: 291768a5007486cfaad822714bd1ceeca0bf0c70 [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
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * 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 Landob3d48982017-06-11 14:22:02 +030031 StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider
Michael Landoed64b5e2017-06-09 03:19:04 +030032} from "./utils/ng1-upgraded-provider";
33import {ConfigService} from "./services/config.service";
Michael Landoed64b5e2017-06-09 03:19:04 +030034import {HttpModule} from '@angular/http';
Avi Zivf5854fd2017-07-31 15:50:46 +030035import {HttpService} from './services/http.service';
Michael Landoed64b5e2017-06-09 03:19:04 +030036import {AuthenticationService} from './services/authentication.service';
37import {Cookie2Service} from "./services/cookie.service";
38import {ComponentServiceNg2} from "./services/component-services/component.service";
39import {ServiceServiceNg2} from "./services/component-services/service.service";
40import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service";
Tal Gitelman51d50f02017-12-10 18:55:03 +020041import {ModalService} from "./services/modal.service";
42import {UiElementsModule} from "./components/ui/ui-elements.module";
43import {ConnectionWizardModule} from "./pages/connection-wizard/connection-wizard.module";
44import {LayoutModule} from "./components/layout/layout.module";
45import {UserService} from "./services/user.service";
46import {SdcConfig} from "./config/sdc-config.config";
47import { TranslateModule } from "./shared/translator/translate.module";
48import { TranslationServiceConfig } from "./config/translation.service.config";
Michael Landoed64b5e2017-06-09 03:19:04 +030049
50export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
51
52export function configServiceFactory(config:ConfigService) {
53 return () => config.loadValidationConfiguration();
54}
55
Michael Landoed64b5e2017-06-09 03:19:04 +030056
57@NgModule({
58 declarations: [
Tal Gitelman51d50f02017-12-10 18:55:03 +020059 AppComponent
Michael Landoed64b5e2017-06-09 03:19:04 +030060 ],
61 imports: [
62 BrowserModule,
63 UpgradeModule,
64 FormsModule,
65 HttpModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +020066 LayoutModule,
67 TranslateModule,
68 UiElementsModule,
69
70 //We need to import them here since we use them in angular1
71 ConnectionWizardModule,
Michael Landoed64b5e2017-06-09 03:19:04 +030072 PropertiesAssignmentModule
73 ],
74 exports: [],
Tal Gitelman51d50f02017-12-10 18:55:03 +020075 entryComponents: [],
Michael Landoed64b5e2017-06-09 03:19:04 +030076 providers: [
Michael Landoed64b5e2017-06-09 03:19:04 +030077 DataTypesServiceProvider,
78 SharingServiceProvider,
79 CookieServiceProvider,
Tal Gitelman51d50f02017-12-10 18:55:03 +020080 StateServiceFactory,
Michael Landoed64b5e2017-06-09 03:19:04 +030081 StateParamsServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +030082 CacheServiceProvider,
83 EventListenerServiceProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +030084 AuthenticationService,
85 Cookie2Service,
86 ConfigService,
87 ComponentServiceNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +020088 ModalService,
Michael Landoed64b5e2017-06-09 03:19:04 +030089 ServiceServiceNg2,
Avi Zivf5854fd2017-07-31 15:50:46 +030090 HttpService,
Tal Gitelman51d50f02017-12-10 18:55:03 +020091 UserService,
92 SdcConfig,
Michael Landoed64b5e2017-06-09 03:19:04 +030093 ComponentInstanceServiceNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +020094 TranslationServiceConfig,
Michael Landoed64b5e2017-06-09 03:19:04 +030095 {
96 provide: APP_INITIALIZER,
97 useFactory: configServiceFactory,
98 deps: [ConfigService],
99 multi: true
Tal Gitelmaned7e1c32017-06-29 19:30:00 +0300100 },
Michael Landoed64b5e2017-06-09 03:19:04 +0300101 ],
102 bootstrap: [AppComponent]
103})
104
105
106export class AppModule {
Michael Landoed64b5e2017-06-09 03:19:04 +0300107
Tal Gitelman51d50f02017-12-10 18:55:03 +0200108 constructor(public upgrade:UpgradeModule) {
Michael Landoed64b5e2017-06-09 03:19:04 +0300109
110 }
111}