app.ts 3.45 KB
Newer Older
1 2 3 4 5
import "reflect-metadata";
import "babel-polyfill";
import "core-js/es6";
import "core-js/es7/reflect";
import { NgModule } from "@angular/core";
6
import { NgReduxModule, DevToolsExtension, NgRedux } from "@angular-redux/store";
7 8 9 10
import {BrowserModule} from "@angular/platform-browser";
import { CookieModule } from "ngx-cookie";
import { MyDatePickerModule } from "mydatepicker";
import { NguiAutoCompleteModule } from "@ngui/auto-complete";
11
import {
12 13
    FormsModule,
    ReactiveFormsModule,
14
} from "@angular/forms";
15

16 17
import {RouterModule} from "@angular/router";
import { HttpModule } from "@angular/http";
18
import {
19 20 21 22
    APP_BASE_HREF,
    HashLocationStrategy,
    LocationStrategy,
    NgLocalization,
23
} from "@angular/common";
24

25 26 27
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import Main from "./containers/main";
import { APP_ROUTER_PROVIDERS, APP_DECLARATIONS } from "./app.routes";
28

29 30 31 32 33 34 35 36 37 38 39 40
import {HelperDataService} from "./services/helper-data-service";
import {LoaderService} from "./services/Spinner.service";
import {AuthService} from "./services/auth.service";
import SchoolAuthGuard from "./guards/school.auth.guard";
import SchoolStudentsLockedGuard from "./guards/school.students.locked.guard";
import SchoolCapacityLockedGuard from "./guards/school.capacity.locked.guard";
import StudentAuthGuard from "./guards/student.auth.guard";
import ReportsAuthGuard from "./guards/reports.auth.guard";
import StudentLockGuard from "./guards/student.lock.guard";
import RegionEduAuthGuard from "./guards/regionedu.auth.guard";
import EduAdminAuthGuard from "./guards/eduadmin.auth.guard";
import MinistryAuthGuard from "./guards/ministry.auth.guard";
Open Source Developer's avatar
Open Source Developer committed
41

42 43 44 45
import * as $ from "jquery";
import { ACTION_PROVIDERS } from "./actions";
import Home from "./components/home";
import { Ng2SmartTableModule, LocalDataSource } from "ng2-smart-table";
46

47 48 49 50
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";
51

52
import {enableProdMode} from "@angular/core";
53

54
class MyLocalization extends NgLocalization {
55 56 57 58 59
    getPluralCategory(value: any) {
        if (value < 5) {
            return "few";
        }
    }
60 61 62
}

@NgModule({
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
    imports: [
        BrowserModule,
        MyDatePickerModule,
        FormsModule,
        NguiAutoCompleteModule,
        RouterModule,
        ReactiveFormsModule,
        APP_ROUTER_PROVIDERS,
        HttpModule,
        Ng2SmartTableModule,
        NgReduxModule,
        CookieModule.forRoot()
    ],
    declarations: [
        Main, FooterComponent, HeaderComponent, NavbarComponent, MainComponent,
        APP_DECLARATIONS,
    ],
    bootstrap: [Main],
    providers: [
        { provide: APP_BASE_HREF, useValue: "/" },
        { provide: LocationStrategy, useClass: HashLocationStrategy },
        { provide: NgLocalization, useClass: MyLocalization },
        DevToolsExtension,
        ACTION_PROVIDERS,
        // Service1, again services here
        HelperDataService,
        LoaderService,
        AuthService,
        SchoolAuthGuard,
        SchoolStudentsLockedGuard,
        SchoolCapacityLockedGuard,
        StudentAuthGuard,
        StudentLockGuard,
        RegionEduAuthGuard,
        EduAdminAuthGuard,
        MinistryAuthGuard,
        ReportsAuthGuard
    ]
101
})
102
class AppModule { }
103

104
// enableProdMode();
105
platformBrowserDynamic().bootstrapModule(AppModule);