app.ts 3.37 KB
Newer Older
1 2 3
import "babel-polyfill";
import "core-js/es6";
import "core-js/es7/reflect";
4
import "reflect-metadata";
5

6 7 8 9 10
import { DevToolsExtension, NgReduxModule } from "@angular-redux/store";
import { APP_BASE_HREF, HashLocationStrategy, LocationStrategy, NgLocalization } from "@angular/common";
import { NgModule } from "@angular/core";
import { enableProdMode } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
11
import { HttpModule } from "@angular/http";
12
import { BrowserModule } from "@angular/platform-browser";
13
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
14 15 16 17 18
import { RouterModule } from "@angular/router";
import { NguiAutoCompleteModule } from "@ngui/auto-complete";
import { MyDatePickerModule } from "mydatepicker";
import { Ng2SmartTableModule } from "ng2-smart-table";
import { CookieModule } from "ngx-cookie";
19

20 21 22 23 24 25 26 27 28 29 30
import { ACTION_PROVIDERS } from "./actions";
import { APP_DECLARATIONS, APP_ROUTER_PROVIDERS } from "./app.routes";
import FooterComponent from "./components/footer/footer.component";
import HeaderComponent from "./components/header/header.component";
import MainComponent from "./components/main/main.component";
import NavbarComponent from "./components/navbar/navbar.component";
import Main from "./containers/main";
import EduAdminAuthGuard from "./guards/eduadmin.auth.guard";
import MinistryAuthGuard from "./guards/ministry.auth.guard";
import RegionEduAuthGuard from "./guards/regionedu.auth.guard";
import ReportsAuthGuard from "./guards/reports.auth.guard";
31 32
import SchoolAuthGuard from "./guards/school.auth.guard";
import SchoolCapacityLockedGuard from "./guards/school.capacity.locked.guard";
33
import SchoolStudentsLockedGuard from "./guards/school.students.locked.guard";
34 35
import StudentAuthGuard from "./guards/student.auth.guard";
import StudentLockGuard from "./guards/student.lock.guard";
36 37 38
import { AuthService } from "./services/auth.service";
import { HelperDataService } from "./services/helper-data-service";
import { LoaderService } from "./services/Spinner.service";
Open Source Developer's avatar
Open Source Developer committed
39

40
import * as $ from "jquery";
41

42
class MyLocalization extends NgLocalization {
43 44 45 46 47
    getPluralCategory(value: any) {
        if (value < 5) {
            return "few";
        }
    }
48 49 50
}

@NgModule({
51 52 53 54 55 56 57 58 59 60 61 62 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
    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
    ]
89
})
90
class AppModule { }
91

92
enableProdMode();
93
platformBrowserDynamic().bootstrapModule(AppModule);