Final commit to master merge from
[sdc.git] / catalog-ui / src / app / ng2 / app.module.ts
index 57adb8f..291768a 100644 (file)
@@ -27,21 +27,25 @@ import {UpgradeAdapter} from '@angular/upgrade';
 import {UpgradeModule} from '@angular/upgrade/static';
 import {PropertiesAssignmentModule} from './pages/properties-assignment/properties-assignment.module';
 import {
-    DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider,
+    DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory,
     StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider
 } from "./utils/ng1-upgraded-provider";
 import {ConfigService} from "./services/config.service";
 import {HttpModule} from '@angular/http';
+import {HttpService} from './services/http.service';
 import {AuthenticationService} from './services/authentication.service';
 import {Cookie2Service} from "./services/cookie.service";
 import {ComponentServiceNg2} from "./services/component-services/component.service";
 import {ServiceServiceNg2} from "./services/component-services/service.service";
 import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service";
-import { InterceptorService } from 'ng2-interceptors';
-import { XHRBackend, RequestOptions } from '@angular/http';
-import {HttpInterceptor} from "./services/http.interceptor.service";
-import { SearchBarComponent } from './shared/search-bar/search-bar.component';
-import { SearchWithAutoCompleteComponent } from './shared/search-with-autocomplete/search-with-autocomplete.component';
+import {ModalService} from "./services/modal.service";
+import {UiElementsModule} from "./components/ui/ui-elements.module";
+import {ConnectionWizardModule} from "./pages/connection-wizard/connection-wizard.module";
+import {LayoutModule} from "./components/layout/layout.module";
+import {UserService} from "./services/user.service";
+import {SdcConfig} from "./config/sdc-config.config";
+import { TranslateModule } from "./shared/translator/translate.module";
+import { TranslationServiceConfig } from "./config/translation.service.config";
 
 export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
 
@@ -49,36 +53,31 @@ export function configServiceFactory(config:ConfigService) {
     return () => config.loadValidationConfiguration();
 }
 
-export function interceptorFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions){
-    let service = new InterceptorService(xhrBackend, requestOptions);
-      service.addInterceptor(new HttpInterceptor());
-    return service;
-}
-
-
-// export function httpServiceFactory(backend: XHRBackend, options: RequestOptions) {
-//     return new HttpService(backend, options);
-// }
 
 @NgModule({
     declarations: [
-        AppComponent,
-        SearchBarComponent,
-        SearchWithAutoCompleteComponent
+        AppComponent
     ],
     imports: [
         BrowserModule,
         UpgradeModule,
         FormsModule,
         HttpModule,
+        LayoutModule,
+        TranslateModule,
+        UiElementsModule,
+
+        //We need to import them here since we use them in angular1
+        ConnectionWizardModule,
         PropertiesAssignmentModule
     ],
     exports: [],
-    entryComponents: [SearchWithAutoCompleteComponent],
+    entryComponents: [],
     providers: [
         DataTypesServiceProvider,
         SharingServiceProvider,
         CookieServiceProvider,
+        StateServiceFactory,
         StateParamsServiceFactory,
         CacheServiceProvider,
         EventListenerServiceProvider,
@@ -86,28 +85,27 @@ export function interceptorFactory(xhrBackend: XHRBackend, requestOptions: Reque
         Cookie2Service,
         ConfigService,
         ComponentServiceNg2,
+        ModalService,
         ServiceServiceNg2,
+        HttpService,
+        UserService,
+        SdcConfig,
         ComponentInstanceServiceNg2,
+        TranslationServiceConfig,
         {
             provide: APP_INITIALIZER,
             useFactory: configServiceFactory,
             deps: [ConfigService],
             multi: true
         },
-        {
-            provide: InterceptorService,
-            useFactory: interceptorFactory,
-            deps: [XHRBackend, RequestOptions]
-        }
      ],
     bootstrap: [AppComponent]
 })
 
 
 export class AppModule {
-   // ngDoBootstrap() {}
-    constructor(public upgrade:UpgradeModule) {
 
+    constructor(public upgrade:UpgradeModule) {
 
     }
 }