blob: ea73d382e2e840b4b457ca7d701a5d0119f759fc [file] [log] [blame]
Michael Landoed64b5e2017-06-09 03:19:04 +03001import {BrowserModule} from '@angular/platform-browser';
2import {NgModule, APP_INITIALIZER} from '@angular/core';
3import {FormsModule} from '@angular/forms';
4import {forwardRef} from '@angular/core';
5import {AppComponent} from './app.component';
6import {UpgradeAdapter} from '@angular/upgrade';
7import {UpgradeModule} from '@angular/upgrade/static';
8import {PropertiesAssignmentModule} from './pages/properties-assignment/properties-assignment.module';
9import {
10 DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider,
Michael Landob3d48982017-06-11 14:22:02 +030011 StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider
Michael Landoed64b5e2017-06-09 03:19:04 +030012} from "./utils/ng1-upgraded-provider";
13import {ConfigService} from "./services/config.service";
14import {HttpService} from "./services/http.service";
15import {HttpModule} from '@angular/http';
16import {AuthenticationService} from './services/authentication.service';
17import {Cookie2Service} from "./services/cookie.service";
18import {ComponentServiceNg2} from "./services/component-services/component.service";
19import {ServiceServiceNg2} from "./services/component-services/service.service";
20import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service";
21
22export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
23
24export function configServiceFactory(config:ConfigService) {
25 return () => config.loadValidationConfiguration();
26}
27
28// export function httpServiceFactory(backend: XHRBackend, options: RequestOptions) {
29// return new HttpService(backend, options);
30// }
31
32@NgModule({
33 declarations: [
34 AppComponent
35 ],
36 imports: [
37 BrowserModule,
38 UpgradeModule,
39 FormsModule,
40 HttpModule,
41 PropertiesAssignmentModule
42 ],
43 exports: [],
44 entryComponents: [],
45 providers: [
46 HttpService,
47 DataTypesServiceProvider,
48 SharingServiceProvider,
49 CookieServiceProvider,
50 StateParamsServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +030051 CacheServiceProvider,
52 EventListenerServiceProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +030053 AuthenticationService,
54 Cookie2Service,
55 ConfigService,
56 ComponentServiceNg2,
57 ServiceServiceNg2,
58 ComponentInstanceServiceNg2,
59 {
60 provide: APP_INITIALIZER,
61 useFactory: configServiceFactory,
62 deps: [ConfigService],
63 multi: true
64 }
65 ],
66 bootstrap: [AppComponent]
67})
68
69
70export class AppModule {
71 // ngDoBootstrap() {}
72 constructor(public upgrade:UpgradeModule) {
73
74
75 }
76}