diff --git a/src/main/webapp/app/entities/entity.module.ts b/src/main/webapp/app/entities/entity.module.ts index 3f03a5db..a8e173fe 100644 --- a/src/main/webapp/app/entities/entity.module.ts +++ b/src/main/webapp/app/entities/entity.module.ts @@ -17,22 +17,20 @@ * limitations under the License. */ import { NgModule } from '@angular/core'; -import { StatisticsComponent } from './statistics/statistics.component'; import { RouterModule } from '@angular/router'; -import { STATISTICS_ROUTE } from './statistics/statistics.route'; -import { JhonlineSharedModule } from 'app/shared/shared.module'; /* jhipster-needle-add-entity-module-import - JHipster will add entity modules imports here */ @NgModule({ // prettier-ignore imports: [ - JhonlineSharedModule, - RouterModule.forRoot([STATISTICS_ROUTE]) + RouterModule.forChild([ + { + path: 'statistics', + loadChildren: () => import('./statistics/statistics.module').then(m => m.JhonlineStatisticsModule), + } /* jhipster-needle-add-entity-module - JHipster will add entity modules here */ - ], - declarations: [StatisticsComponent], - entryComponents: [], - providers: [] + ]), + ] }) export class JhonlineEntityModule {} diff --git a/src/main/webapp/app/entities/statistics/statistics.module.ts b/src/main/webapp/app/entities/statistics/statistics.module.ts new file mode 100644 index 00000000..ebbaeb1e --- /dev/null +++ b/src/main/webapp/app/entities/statistics/statistics.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { JhonlineSharedModule } from 'app/shared/shared.module'; +import { statisticsRoute } from 'app/entities/statistics/statistics.route'; +import { StatisticsComponent } from 'app/entities/statistics/statistics.component'; + +@NgModule({ + imports: [JhonlineSharedModule, RouterModule.forChild([statisticsRoute])], + declarations: [StatisticsComponent] +}) +export class JhonlineStatisticsModule {} diff --git a/src/main/webapp/app/entities/statistics/statistics.route.ts b/src/main/webapp/app/entities/statistics/statistics.route.ts index 641ee9bc..9cdfe2ac 100644 --- a/src/main/webapp/app/entities/statistics/statistics.route.ts +++ b/src/main/webapp/app/entities/statistics/statistics.route.ts @@ -21,12 +21,12 @@ import { Route } from '@angular/router'; import { StatisticsComponent } from './statistics.component'; import { UserRouteAccessService } from 'app/core/auth/user-route-access-service'; -export const STATISTICS_ROUTE: Route = { - path: 'statistics', - component: StatisticsComponent, - data: { - authorities: [], - pageTitle: 'Statistics' - }, - canActivate: [UserRouteAccessService] +export const statisticsRoute: Route = { + path: '', + component: StatisticsComponent, + data: { + authorities: [], + pageTitle: 'Statistics' + }, + canActivate: [UserRouteAccessService] }; diff --git a/src/main/webapp/app/layouts/layout-routing.module.ts b/src/main/webapp/app/layouts/layout-routing.module.ts deleted file mode 100644 index 15c47a6d..00000000 --- a/src/main/webapp/app/layouts/layout-routing.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2017-2020 the original author or authors from the JHipster Online project. - * - * This file is part of the JHipster Online project, see https://github.com/jhipster/jhipster-online - * for more information. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import { navbarRoute } from 'app/layouts/navbar/navbar.route'; -import { errorRoute } from './error/error.route'; - -const LAYOUT_ROUTES = [navbarRoute, ...errorRoute]; - -@NgModule({ - imports: [RouterModule.forRoot(LAYOUT_ROUTES)], - exports: [RouterModule] -}) -export class LayoutRoutingModule {}