59 lines
1.7 KiB
TypeScript
Executable File
59 lines
1.7 KiB
TypeScript
Executable File
import { NgModule } from '@angular/core';
|
|
import { RouterModule } from '@angular/router';
|
|
|
|
import { errorRoute } from './layouts/error/error.route';
|
|
import { DEBUG_INFO_ENABLED } from 'app/app.constants';
|
|
import { Authority } from 'app/config/authority.constants';
|
|
|
|
import HomeComponent from './home/home.component';
|
|
import NavbarComponent from './layouts/navbar/navbar.component';
|
|
import LoginComponent from './login/login.component';
|
|
|
|
import { UserRouteAccessService } from 'app/core/auth/user-route-access.service';
|
|
import { DynamicTabsComponent } from './dynamic-tabs/dynamic-tabs.component';
|
|
|
|
@NgModule({
|
|
imports: [
|
|
RouterModule.forRoot(
|
|
[
|
|
{
|
|
path: '',
|
|
component: HomeComponent,
|
|
title: 'Welcome, Java Hipster!',
|
|
},
|
|
{
|
|
path: '',
|
|
component: NavbarComponent,
|
|
outlet: 'navbar',
|
|
},
|
|
{
|
|
path: 'admin',
|
|
data: {
|
|
authorities: [Authority.ADMIN],
|
|
},
|
|
canActivate: [UserRouteAccessService],
|
|
loadChildren: () => import('./admin/admin-routing.module'),
|
|
},
|
|
{
|
|
path: 'login',
|
|
component: LoginComponent,
|
|
title: 'Sign in',
|
|
},
|
|
{
|
|
path: 'dynamictabs',
|
|
component: DynamicTabsComponent,
|
|
title: 'Dynamic tabs sample',
|
|
},
|
|
{
|
|
path: '',
|
|
loadChildren: () => import(`./entities/entity-routing.module`).then(({ EntityRoutingModule }) => EntityRoutingModule),
|
|
},
|
|
...errorRoute,
|
|
],
|
|
{ enableTracing: DEBUG_INFO_ENABLED, bindToComponentInputs: true }
|
|
),
|
|
],
|
|
exports: [RouterModule],
|
|
})
|
|
export class AppRoutingModule {}
|