app.ts 2.74 KB
Newer Older
1 2 3 4
import 'reflect-metadata';
import 'babel-polyfill';
import 'core-js/es6';
import 'core-js/es7/reflect';
5
import { NgModule } from '@angular/core';
6
import { NgReduxModule, DevToolsExtension, NgRedux } from 'ng2-redux';
7
import {BrowserModule} from '@angular/platform-browser';
8
import { CookieModule } from 'ngx-cookie';
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
import {
  FormsModule,
  ReactiveFormsModule,
} from '@angular/forms';

import {RouterModule} from '@angular/router';
import { HttpModule } from '@angular/http';
import {
  APP_BASE_HREF,
  HashLocationStrategy,
  LocationStrategy,
  NgLocalization,
} from '@angular/common';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import Main from './containers/main';
import { APP_ROUTER_PROVIDERS, APP_DECLARATIONS } from './app.routes';

/* Here we import services */
29
import {HelperDataService} from './services/helper-data-service';
Open Source Developer's avatar
Open Source Developer committed
30
import {LoaderService} from './services/Spinner.service';
31 32 33
import {AuthService} from './services/auth.service';
import SchoolAuthGuard from './guards/school.auth.guard';
import StudentAuthGuard from './guards/student.auth.guard';
Open Source Developer's avatar
trans  
Open Source Developer committed
34
import RegionEduAuthGuard from './guards/regionedu.auth.guard';
Open Source Developer's avatar
Open Source Developer committed
35

36
import { ACTION_PROVIDERS } from './actions';
37
import Home from './components/home';
38
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
39 40 41 42 43

import HeaderComponent from './components/header/header.component';
import NavbarComponent from './components/navbar/navbar.component';
import MainComponent from './components/main/main.component';
import FooterComponent from './components/footer/footer.component';
44 45 46 47
import { ModalModule } from 'ng2-bootstrap/modal';
import { AlertModule } from 'ng2-bootstrap/alert';

import {enableProdMode} from '@angular/core';
48

49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
class MyLocalization extends NgLocalization {
   getPluralCategory(value: any) {
      if (value < 5) {
         return 'few';
      }
   }
}

@NgModule({
  imports:      [
    BrowserModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    APP_ROUTER_PROVIDERS,
    HttpModule,
65
    Ng2SmartTableModule,
Open Source Developer's avatar
Open Source Developer committed
66
    NgReduxModule,
67
    ModalModule.forRoot(),
68 69
    AlertModule.forRoot(),
    CookieModule.forRoot()
70 71
  ],
  declarations: [
72
    Main, FooterComponent, HeaderComponent, NavbarComponent, MainComponent,
73 74 75 76 77 78 79
    APP_DECLARATIONS,
  ],
  bootstrap: [ Main ],
  providers: [
    { provide: APP_BASE_HREF, useValue: '/' },
    { provide: LocationStrategy, useClass: HashLocationStrategy },
    { provide: NgLocalization, useClass: MyLocalization },
80 81
    DevToolsExtension,
    ACTION_PROVIDERS,
82
    //Service1, again services here
83
    HelperDataService,
Open Source Developer's avatar
Open Source Developer committed
84
    LoaderService,
85 86
    AuthService,
    SchoolAuthGuard,
Open Source Developer's avatar
trans  
Open Source Developer committed
87 88 89
    StudentAuthGuard,
    RegionEduAuthGuard

90 91 92 93
  ]
})
class AppModule {}

94
// enableProdMode();
95
platformBrowserDynamic().bootstrapModule(AppModule);