38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
|
|
import { NgModule } from '@angular/core';
|
||
|
|
import { RouterModule, Routes } from '@angular/router';
|
||
|
|
import { SidebarContentComponent } from './content/sidebar-content/sidebar-content.component';
|
||
|
|
import { LicensePrivacyTermsComponent } from './component/license-privacy-terms/license-privacy-terms.component';
|
||
|
|
import { authGuard } from './services/auth.guard';
|
||
|
|
|
||
|
|
const routes: Routes = [
|
||
|
|
|
||
|
|
{ path: 'login', loadChildren: () => import('./controls/login-control/login-control.module').then(m => m.LoginControlModule) },
|
||
|
|
|
||
|
|
{ path: 'c', component: LicensePrivacyTermsComponent},
|
||
|
|
|
||
|
|
{
|
||
|
|
path: 'main',
|
||
|
|
component: SidebarContentComponent,
|
||
|
|
canActivate: [authGuard],
|
||
|
|
children: [
|
||
|
|
{
|
||
|
|
path: '',
|
||
|
|
loadChildren: () =>
|
||
|
|
import('./controls/main-control/main-control.module').then(
|
||
|
|
(m) => m.MainControlModule
|
||
|
|
),
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
|
||
|
|
{ path: '', redirectTo: 'login', pathMatch: 'full' },
|
||
|
|
|
||
|
|
{ path: '**', redirectTo: 'login' }
|
||
|
|
];
|
||
|
|
|
||
|
|
@NgModule({
|
||
|
|
imports: [RouterModule.forRoot(routes)],
|
||
|
|
exports: [RouterModule]
|
||
|
|
})
|
||
|
|
export class AppRoutingModule {}
|