-
Notifications
You must be signed in to change notification settings - Fork 11
/
ngDashboardAppMod.ts
49 lines (43 loc) · 2.38 KB
/
ngDashboardAppMod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//todo: mejorar el estado 'loading' chart en pagLinearChart
//todo: hacer una directiva para contenido responsivo
//todo: gestionar cuando una peticion http a un fichero de datos json da error/cancelar
import {NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {RouterModule, Routes} from "@angular/router";
import {HttpModule} from "@angular/http";
import {MlPageLoaderMod} from "./ml/components/loader/mlContentLoaderMod";
import {MlLayoutMod} from "./ml/components/layout/mlLayoutMod";
import {MlMenuMod} from "./ml/components/menu/mlMenuMod";
import {MlBadgeMod} from "./ml/components/badge/mlBadgeMod";
import {MlTooltipMod} from "./ml/components/tooltip/mlTooltipMod";
import {YagoFullscreenMod} from "./ml/lib/fullscreen/yagoFullscreenMod";
import {NgDashboardAppCmp} from "./ngDashboardAppCmp";
const getUrlParameter = (name: string) => {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
let regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
let results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
// Absolute paths for Webpack
let basePath = 'C:/Users/UsuarioAurora/Documents/WebstormProjects/ng-dashboard/src/app/pages/';
if(getUrlParameter('serve') === 'systemjs'){
// Relative paths for SystemJS
basePath = './app/pages/';
}
const APP_ROUTES: Routes = [
{path: '', redirectTo: 'about', pathMatch: 'full'},
{path: 'about', loadChildren: basePath + 'about/pagAboutMod#PagAboutMod'},
{path: 'linear', loadChildren: basePath + 'linear/pagLinearChartMod#PagLinearChartMod'},
{path: 'points', loadChildren: basePath + 'points/pagPointsChartMod#PagPointsChartMod'},
{path: 'bars', loadChildren: basePath + 'bars/pagBarsChartMod#PagBarsChartMod'},
{path: 'maps', loadChildren: basePath + 'maps/pagMapsMod#PagMapsMod'},
{path: 'mailbox', loadChildren: basePath + 'mailbox/pagMailboxMod#PagMailboxMod'},
{path: 'profile', loadChildren: basePath + 'profile/pagProfileMod#PagProfileMod'},
{path: '**', redirectTo: 'about'}
];
@NgModule({
imports: [BrowserModule, HttpModule, MlPageLoaderMod, MlLayoutMod, MlMenuMod, MlBadgeMod, MlTooltipMod,
YagoFullscreenMod, RouterModule.forRoot(APP_ROUTES, {enableTracing: false, useHash: true})],
declarations: [NgDashboardAppCmp], bootstrap: [NgDashboardAppCmp]
})
export class NgDashboardMod {}