ucap-lg-web/src/app/app-routing.module.ts
Park Byung Eun eded98a6cf sync
2020-08-10 14:05:32 +09:00

91 lines
2.3 KiB
TypeScript

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DefaultLayoutComponent } from '@app/layouts/components/default.layout.component';
import { NoNaviLayoutComponent } from '@app/layouts/components/no-navi.layout.component';
import { AppAuthenticationGuard } from '@app/guards/app-authentication.guard';
import { AppSessionResolver } from './resolvers/app-session.resolver';
import { NavigationType } from './types';
const routes: Routes = [
{
path: '',
redirectTo: `/${NavigationType.Group}/(content:index)`,
pathMatch: 'full'
},
{
path: 'account',
component: NoNaviLayoutComponent,
loadChildren: () =>
import('./pages/account/account.page.module').then(
(m) => m.AppAccountPageModule
)
},
{
path: 'common',
component: NoNaviLayoutComponent,
loadChildren: () =>
import('./pages/common/common.page.module').then(
(m) => m.AppCommonPageModule
)
},
{
path: '',
component: DefaultLayoutComponent,
canActivate: [AppAuthenticationGuard],
resolve: {
authentication: AppSessionResolver
},
children: [
{
path: NavigationType.Organization,
loadChildren: () =>
import('./pages/organization/organization.page.module').then(
(m) => m.AppOrganizationPageModule
)
},
{
path: NavigationType.Group,
loadChildren: () =>
import('./pages/group/group.page.module').then(
(m) => m.AppGroupPageModule
)
},
{
path: NavigationType.Chat,
loadChildren: () =>
import('./pages/chat/chat.page.module').then(
(m) => m.AppChatPageModule
)
},
{
path: NavigationType.Call,
loadChildren: () =>
import('./pages/call/call.page.module').then(
(m) => m.AppCallPageModule
)
},
{
path: NavigationType.Message,
loadChildren: () =>
import('./pages/message/message.page.module').then(
(m) => m.AppMessagePageModule
)
}
]
},
{
path: '**',
redirectTo: '/common/e404'
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { useHash: true, enableTracing: false })
],
exports: [RouterModule]
})
export class AppRoutingModule {}