blob: 9e122cd288c2348f0f01a35a59d198022c729f9b [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,
11 StateParamsServiceFactory
12} 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,
51 AuthenticationService,
52 Cookie2Service,
53 ConfigService,
54 ComponentServiceNg2,
55 ServiceServiceNg2,
56 ComponentInstanceServiceNg2,
57 {
58 provide: APP_INITIALIZER,
59 useFactory: configServiceFactory,
60 deps: [ConfigService],
61 multi: true
62 }
63 ],
64 bootstrap: [AppComponent]
65})
66
67
68export class AppModule {
69 // ngDoBootstrap() {}
70 constructor(public upgrade:UpgradeModule) {
71
72
73 }
74}