Skip to content

Commit

Permalink
Merge pull request #177 from vishal423/lazy-load-modules
Browse files Browse the repository at this point in the history
Lazy load statistics module
  • Loading branch information
SudharakaP authored Jun 8, 2020
2 parents 2992aa3 + b7fccd4 commit 7a4ffbd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 48 deletions.
16 changes: 7 additions & 9 deletions src/main/webapp/app/entities/entity.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
12 changes: 12 additions & 0 deletions src/main/webapp/app/entities/statistics/statistics.module.ts
Original file line number Diff line number Diff line change
@@ -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 {}
16 changes: 8 additions & 8 deletions src/main/webapp/app/entities/statistics/statistics.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
};
31 changes: 0 additions & 31 deletions src/main/webapp/app/layouts/layout-routing.module.ts

This file was deleted.

0 comments on commit 7a4ffbd

Please sign in to comment.