blob: 88c2d876c4e1f03f3966134f9680494c993ff33e [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 {
30 DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider,
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 Gitelmaned7e1c32017-06-29 19:30:00 +030041import { XHRBackend, RequestOptions } from '@angular/http';
Michael Lando39a4e0c2017-07-18 20:46:42 +030042import { SearchBarComponent } from './shared/search-bar/search-bar.component';
43import { SearchWithAutoCompleteComponent } from './shared/search-with-autocomplete/search-with-autocomplete.component';
Michael Landoed64b5e2017-06-09 03:19:04 +030044
45export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
46
47export function configServiceFactory(config:ConfigService) {
48 return () => config.loadValidationConfiguration();
49}
50
Michael Landoed64b5e2017-06-09 03:19:04 +030051
52@NgModule({
53 declarations: [
Michael Lando39a4e0c2017-07-18 20:46:42 +030054 AppComponent,
55 SearchBarComponent,
56 SearchWithAutoCompleteComponent
Michael Landoed64b5e2017-06-09 03:19:04 +030057 ],
58 imports: [
59 BrowserModule,
60 UpgradeModule,
61 FormsModule,
62 HttpModule,
63 PropertiesAssignmentModule
64 ],
65 exports: [],
Michael Lando39a4e0c2017-07-18 20:46:42 +030066 entryComponents: [SearchWithAutoCompleteComponent],
Michael Landoed64b5e2017-06-09 03:19:04 +030067 providers: [
Michael Landoed64b5e2017-06-09 03:19:04 +030068 DataTypesServiceProvider,
69 SharingServiceProvider,
70 CookieServiceProvider,
71 StateParamsServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +030072 CacheServiceProvider,
73 EventListenerServiceProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +030074 AuthenticationService,
75 Cookie2Service,
76 ConfigService,
77 ComponentServiceNg2,
78 ServiceServiceNg2,
Avi Zivf5854fd2017-07-31 15:50:46 +030079 HttpService,
Michael Landoed64b5e2017-06-09 03:19:04 +030080 ComponentInstanceServiceNg2,
81 {
82 provide: APP_INITIALIZER,
83 useFactory: configServiceFactory,
84 deps: [ConfigService],
85 multi: true
Tal Gitelmaned7e1c32017-06-29 19:30:00 +030086 },
Michael Landoed64b5e2017-06-09 03:19:04 +030087 ],
88 bootstrap: [AppComponent]
89})
90
91
92export class AppModule {
93 // ngDoBootstrap() {}
94 constructor(public upgrade:UpgradeModule) {
95
96
97 }
98}