app.module.ts 3.46 KB
Newer Older
Ooh-Ao committed
1 2
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Ooh-Ao committed
3 4 5
import {
  CommonModule
} from '@angular/common';
Ooh-Ao committed
6
import { NgModule } from '@angular/core';
Ooh-Ao committed
7 8 9
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';
Ooh-Ao committed
10 11

import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
Ooh-Ao committed
12 13 14 15 16
//import { AgmCoreModule } from '@agm/core';
import { DataTablesModule } from 'angular-datatables';
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
import { Ng2SearchPipeModule } from 'ng2-search-filter';
import { ToastrModule } from 'ngx-toastr';
Ooh-Ao committed
17 18
import { FullComponent } from './layouts/full/full.component';
import { BlankComponent } from './layouts/blank/blank.component';
Ooh-Ao committed
19 20
import { FeatherModule } from 'angular-feather';
import { allIcons } from 'angular-feather/icons';
Ooh-Ao committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

import { VerticalNavigationComponent } from './shared/vertical-header/vertical-navigation.component';
import { VerticalSidebarComponent } from './shared/vertical-sidebar/vertical-sidebar.component';
import { BreadcrumbComponent } from './shared/breadcrumb/breadcrumb.component';
import { HorizontalNavigationComponent } from './shared/horizontal-header/horizontal-navigation.component';
import { HorizontalSidebarComponent } from './shared/horizontal-sidebar/horizontal-sidebar.component';

import { Approutes } from './app-routing.module';
import { AppComponent } from './app.component';
import { SpinnerComponent } from './shared/spinner.component';

import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar';
import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';

import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
Ooh-Ao committed
38
import { HttpClient } from '@angular/common/http';
Ooh-Ao committed
39 40 41 42 43 44 45 46


export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
  suppressScrollX: true,
Ooh-Ao committed
47
  wheelSpeed: 1,
Ooh-Ao committed
48 49 50 51
  wheelPropagation: true,
  minScrollbarLength: 20
};

Ooh-Ao committed
52 53
// Select some icons (use an object, not an array)

Ooh-Ao committed
54 55 56 57 58 59 60 61 62 63 64

@NgModule({
  declarations: [
    AppComponent,
    SpinnerComponent,
    FullComponent,
    BlankComponent,
    VerticalNavigationComponent,
    BreadcrumbComponent,
    VerticalSidebarComponent,
    HorizontalNavigationComponent,
Ooh-Ao committed
65
    HorizontalSidebarComponent
Ooh-Ao committed
66 67 68 69 70 71
  ],
  imports: [
    CommonModule,
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
Ooh-Ao committed
72 73 74 75
    ToastrModule.forRoot(),
    FeatherModule.pick(allIcons),
    ReactiveFormsModule,
    DataTablesModule,
Ooh-Ao committed
76 77
    HttpClientModule,
    NgbModule,
Ooh-Ao committed
78 79
    FeatherModule,
    Ng2SearchPipeModule,
80
    RouterModule.forRoot(Approutes, { relativeLinkResolution: 'legacy',initialNavigation: 'enabledNonBlocking', useHash: true }),
Ooh-Ao committed
81
    PerfectScrollbarModule,
Ooh-Ao committed
82 83 84 85
    NgMultiSelectDropDownModule.forRoot(),
   // AgmCoreModule.forRoot({ apiKey: 'AIzaSyDoliAneRffQDyA7Ul9cDk3tLe7vaU4yP8' }),


Ooh-Ao committed
86 87 88 89 90 91 92 93 94 95 96 97
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    {
      provide: PERFECT_SCROLLBAR_CONFIG,
      useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
Ooh-Ao committed
98
    }
Ooh-Ao committed
99 100 101 102
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }