Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 1 | import {BrowserModule} from '@angular/platform-browser'; |
| 2 | import {NgModule, APP_INITIALIZER} from '@angular/core'; |
| 3 | import {FormsModule} from '@angular/forms'; |
| 4 | import {forwardRef} from '@angular/core'; |
| 5 | import {AppComponent} from './app.component'; |
| 6 | import {UpgradeAdapter} from '@angular/upgrade'; |
| 7 | import {UpgradeModule} from '@angular/upgrade/static'; |
| 8 | import {PropertiesAssignmentModule} from './pages/properties-assignment/properties-assignment.module'; |
| 9 | import { |
| 10 | DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, |
Michael Lando | b3d4898 | 2017-06-11 14:22:02 +0300 | [diff] [blame] | 11 | StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 12 | } from "./utils/ng1-upgraded-provider"; |
| 13 | import {ConfigService} from "./services/config.service"; |
| 14 | import {HttpService} from "./services/http.service"; |
| 15 | import {HttpModule} from '@angular/http'; |
| 16 | import {AuthenticationService} from './services/authentication.service'; |
| 17 | import {Cookie2Service} from "./services/cookie.service"; |
| 18 | import {ComponentServiceNg2} from "./services/component-services/component.service"; |
| 19 | import {ServiceServiceNg2} from "./services/component-services/service.service"; |
| 20 | import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service"; |
| 21 | |
| 22 | export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); |
| 23 | |
| 24 | export 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 Lando | b3d4898 | 2017-06-11 14:22:02 +0300 | [diff] [blame] | 51 | CacheServiceProvider, |
| 52 | EventListenerServiceProvider, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 53 | 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 | |
| 70 | export class AppModule { |
| 71 | // ngDoBootstrap() {} |
| 72 | constructor(public upgrade:UpgradeModule) { |
| 73 | |
| 74 | |
| 75 | } |
| 76 | } |