From da2139c52ac631a8ecbf57814c9d1619f823db7a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sun, 2 Sep 2018 18:41:24 +0100 Subject: [PATCH] lazy load Settings --- src/app/app.module.ts | 2 - src/app/app.routes.ts | 3 +- .../components/settings/settings.module.ts | 47 +++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/app/components/settings/settings.module.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8df0cfa59..9aa1fc6c1 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -56,7 +56,6 @@ import { ContentManagementService } from './services/content-management.service' import { NodeActionsService } from './services/node-actions.service'; import { NodePermissionService } from './services/node-permission.service'; import { SearchResultsComponent } from './components/search/search-results/search-results.component'; -import { SettingsComponent } from './components/settings/settings.component'; import { ProfileResolver } from './services/profile.resolver'; import { ExperimentalGuard } from './services/experimental-guard.service'; @@ -121,7 +120,6 @@ import { AppToolbarModule } from './components/toolbar/toolbar.module'; NodePermissionsDialogComponent, PermissionsManagerComponent, SearchResultsComponent, - SettingsComponent, SharedLinkViewComponent ], providers: [ diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 64ab1553c..f6dea60bd 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -39,7 +39,6 @@ import { TrashcanComponent } from './components/trashcan/trashcan.component'; import { LoginComponent } from './components/login/login.component'; import { GenericErrorComponent } from './components/generic-error/generic-error.component'; import { SearchResultsComponent } from './components/search/search-results/search-results.component'; -import { SettingsComponent } from './components/settings/settings.component'; import { ProfileResolver } from './services/profile.resolver'; @@ -53,7 +52,7 @@ export const APP_ROUTES: Routes = [ }, { path: 'settings', - component: SettingsComponent, + loadChildren: 'src/app/components/settings/settings.module#AppSettingsModule', data: { title: 'Settings' } diff --git a/src/app/components/settings/settings.module.ts b/src/app/components/settings/settings.module.ts new file mode 100644 index 000000000..884bb297b --- /dev/null +++ b/src/app/components/settings/settings.module.ts @@ -0,0 +1,47 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { NgModule } from '@angular/core'; +import { SettingsComponent } from './settings.component'; +import { Routes, RouterModule } from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { CoreModule } from '@alfresco/adf-core'; + +const routes: Routes = [ + { + path: '', + component: SettingsComponent + } +]; + +@NgModule({ + imports: [ + CommonModule, + CoreModule.forChild(), + RouterModule.forChild(routes) + ], + declarations: [SettingsComponent] +}) +export class AppSettingsModule {}