Skip to content
Snippets Groups Projects
app.module.ts 7.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • import { BrowserModule, HammerModule } from '@angular/platform-browser';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { FormsModule, ReactiveFormsModule } from '@angular/forms';
    
    import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
    
    import { NgModule, Injectable } from '@angular/core';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
    
    import { AuthInterceptor } from './service/auth-interceptor.service';
    
    
    // import ngx-translate and the http loader
    import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
    import { TranslateHttpLoader } from '@ngx-translate/http-loader';
    
    @Injectable()
    
    export class CustomHammerConfig extends HammerGestureConfig {
    
        'pinch': { enable: false },
        'rotate': { enable: false }
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { ScrollEventModule } from 'ngx-scroll-event';
    import { AngularDraggableModule } from 'angular2-draggable';
    
    import { CookieService } from 'ngx-cookie-service';
    
    import { NgPipesModule } from 'ngx-pipes';
    
    import { LatinisePipe } from 'ngx-pipes';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { AppMaterialModule } from './app-material.module';
    
    import { AppRoutingModule } from './app-routing.module';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    
    // COMPONENTS
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { AppComponent } from './app.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { LoginComponent } from './login/login.component';
    
    import { ForgotPasswordComponent } from './login/forgotPassword/forgotPassword.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { SignaturesComponent } from './signatures/signatures.component';
    import { SignaturePadPageComponent } from './pad/pad.component';
    import { SignaturePadModule } from 'angular2-signaturepad';
    import { DrawerComponent } from './drawer/drawer.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { DocumentComponent } from './document/document.component';
    import { DocumentSignListComponent } from './documentSignList/document-sign-list.component';
    import { DocumentNoteListComponent } from './documentNoteList/document-note-list.component';
    import { DocumentNotePadComponent } from './documentNotePad/document-note-pad.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { SidebarComponent } from './sidebar/sidebar.component';
    
    import { ProfileComponent } from './profile/profile.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { ConfirmModalComponent } from './modal/confirm-modal.component';
    import { WarnModalComponent } from './modal/warn-modal.component';
    import { SuccessInfoValidBottomSheetComponent } from './modal/success-info-valid.component';
    import { RejectInfoBottomSheetComponent } from './modal/reject-info.component';
    
    import { OverlayComponent } from './overlay/overlay.component';
    
    import { VisaWorkflowComponent } from './document/visa-workflow/visa-workflow.component';
    
    import { DocumentListComponent } from './document/document-list/document-list.component';
    
    import { MainDocumentDetailComponent } from './document/main-document-detail/main-document-detail.component';
    
    import { UpdatePasswordComponent } from './login/updatePassword/updatePassword.component';
    
    import {PasswordModificationComponent} from './login/passwordModification/password-modification.component';
    
    
    // ADMINISTRATION
    
    import { AdminSidebarComponent } from './sidebar/administration/admin-sidebar.component';
    
    
    import { AdministrationComponent } from './administration/home/administration.component';
    
    import { UsersListComponent } from './administration/user/users-list.component';
    
    import { UserComponent } from './administration/user/user.component';
    
    import { ConnectionComponent } from './administration/connection/connection.component';
    
    import { LdapListComponent } from './administration/connection/ldap/ldap-list.component';
    import { LdapComponent } from './administration/connection/ldap/ldap.component';
    
    import { SendmailComponent } from './administration/sendmail/sendmail.component';
    
    import { GroupsListComponent } from './administration/group/groups-list.component';
    import { GroupComponent } from './administration/group/group.component';
    
    import {SecuritiesAdministrationComponent} from './administration/security/securities-administration.component';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    
    // SERVICES
    
    import { NotificationService, CustomSnackbarComponent } from './service/notification.service';
    
    Alex ORLUC's avatar
    Alex ORLUC committed
    import { SignaturesContentService } from './service/signatures.service';
    
    import { FiltersService } from './service/filters.service';
    
    
    // OTHERS
    import { ConfirmComponent } from './plugins/confirm.component';
    
    import { AlertComponent } from './plugins/alert.component';
    
    import { PluginAutocompleteComponent } from './plugins/autocomplete/autocomplete.component';
    import { SortPipe } from './plugins/sorting.pipe';
    
    import {MatToolbarModule} from '@angular/material/toolbar';
    
    Florian Azizian's avatar
    Florian Azizian committed
    
    
    
    @NgModule({
    
    Alex ORLUC's avatar
    Alex ORLUC committed
      declarations: [
        AppComponent,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        LoginComponent,
    
        ForgotPasswordComponent,
    
        UpdatePasswordComponent,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        SignaturesComponent,
        SignaturePadPageComponent,
        DrawerComponent,
        DocumentComponent,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        DocumentSignListComponent,
        DocumentNoteListComponent,
        DocumentNotePadComponent,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        SidebarComponent,
        WarnModalComponent,
        ConfirmModalComponent,
        SuccessInfoValidBottomSheetComponent,
        RejectInfoBottomSheetComponent,
    
        ProfileComponent,
    
        OverlayComponent,
    
        MainDocumentDetailComponent,
    
        AdministrationComponent,
        UsersListComponent,
    
        ConfirmComponent,
    
        AdminSidebarComponent,
    
        ConnectionComponent,
    
        LdapListComponent,
    
        GroupComponent,
        PluginAutocompleteComponent,
    
        SecuritiesAdministrationComponent,
        PasswordModificationComponent
    
    Alex ORLUC's avatar
    Alex ORLUC committed
      ],
    
        imports: [
            FormsModule,
            ReactiveFormsModule,
            BrowserModule,
            BrowserAnimationsModule,
            HttpClientModule,
            HttpClientModule,
            TranslateModule.forRoot({
                loader: {
                    provide:    TranslateLoader,
                    useFactory: HttpLoaderFactory,
                    deps:       [HttpClient]
                }
            }),
            SignaturePadModule,
            ScrollEventModule,
            NgPipesModule,
            AngularDraggableModule,
            AppMaterialModule,
            AppRoutingModule,
            HammerModule,
            MatToolbarModule,
        ],
    
    Alex ORLUC's avatar
    Alex ORLUC committed
      entryComponents: [
    
        CustomSnackbarComponent,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
        WarnModalComponent,
        ConfirmModalComponent,
        SuccessInfoValidBottomSheetComponent,
        RejectInfoBottomSheetComponent,
    
        SignaturesComponent,
    
        ConfirmComponent,
        AlertComponent
    
    Alex ORLUC's avatar
    Alex ORLUC committed
      ],
    
      providers: [
        { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
        SignaturesContentService,
    
        NotificationService,
    
          provide: HAMMER_GESTURE_CONFIG,
          useClass: CustomHammerConfig
    
        CookieService,
    
    Alex ORLUC's avatar
    Alex ORLUC committed
      bootstrap: [AppComponent]
    
    Florian Azizian's avatar
    Florian Azizian committed
    })
    export class AppModule { }
    
    export class TranslateBackendHttpLoader implements TranslateLoader {
    
      constructor(private http: HttpClient) { }
    
      /**
       * Gets the translations from the server
       * @param lang
       * @returns {any}
       */
      public getTranslation(lang: string): any {
    
    
        return this.http.get(`../rest/languages/` + lang);
    
    
    // For traductions
    export function HttpLoaderFactory(http: HttpClient) {
      return new TranslateBackendHttpLoader(http);
    }