refactor: don't export all modules everywhere

This commit is contained in:
Dmitry Nehaychik 2019-06-12 10:38:33 +03:00
parent df489ad17e
commit c31ff67052
17 changed files with 218 additions and 263 deletions

14
package-lock.json generated
View file

@ -1666,14 +1666,6 @@
"intersection-observer": "0.5.0" "intersection-observer": "0.5.0"
} }
}, },
"@ng-bootstrap/ng-bootstrap": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-4.0.0.tgz",
"integrity": "sha512-jWVHRDUYppOSvzclP9d3lVWGUO+y0X9W6jdfyYehDkJCY0MFgtwefLYMtQ/NJ4niPzm2d/zZn+Bte48iIn0nKw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@ngtools/webpack": { "@ngtools/webpack": {
"version": "8.0.2", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-8.0.2.tgz", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-8.0.2.tgz",
@ -16862,9 +16854,9 @@
} }
}, },
"tsutils": { "tsutils": {
"version": "2.21.2", "version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.21.2.tgz", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-iaIuyjIUeFLdD39MYdzqBuY7Zv6+uGxSwRH4mf+HuzsnznjFz0R2tGrAe0/JvtNh91WrN8UN/DZRFTZNDuVekA==", "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true, "dev": true,
"requires": { "requires": {
"tslib": "^1.8.1" "tslib": "^1.8.1"

View file

@ -45,7 +45,6 @@
"@nebular/eva-icons": "^4.0.0", "@nebular/eva-icons": "^4.0.0",
"@nebular/security": "4.0.0", "@nebular/security": "4.0.0",
"@nebular/theme": "4.0.0", "@nebular/theme": "4.0.0",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
"@swimlane/ngx-charts": "^10.0.0", "@swimlane/ngx-charts": "^10.0.0",
"angular-tree-component": "7.2.0", "angular-tree-component": "7.2.0",
"angular2-chartjs": "0.4.1", "angular2-chartjs": "0.4.1",
@ -79,8 +78,8 @@
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.800.2", "@angular-devkit/build-angular": "~0.800.2",
"@angular/compiler-cli": "^8.0.0",
"@angular/cli": "^8.0.2", "@angular/cli": "^8.0.2",
"@angular/compiler-cli": "^8.0.0",
"@angular/language-service": "8.0.0", "@angular/language-service": "8.0.0",
"@compodoc/compodoc": "1.0.1", "@compodoc/compodoc": "1.0.1",
"@fortawesome/fontawesome-free": "^5.2.0", "@fortawesome/fontawesome-free": "^5.2.0",
@ -106,7 +105,7 @@
"rimraf": "2.6.1", "rimraf": "2.6.1",
"stylelint": "7.13.0", "stylelint": "7.13.0",
"ts-node": "3.2.2", "ts-node": "3.2.2",
"tslint": "5.7.0", "tslint": "^5.7.0",
"tslint-language-service": "^0.9.9", "tslint-language-service": "^0.9.9",
"typescript": "3.4.5" "typescript": "3.4.5"
} }

View file

@ -1,42 +1,17 @@
import { ModuleWithProviders, NgModule } from '@angular/core'; import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { import {
NbActionsModule, NbActionsModule,
NbCardModule,
NbLayoutModule, NbLayoutModule,
NbMenuModule, NbMenuModule,
NbRouteTabsetModule,
NbSearchModule, NbSearchModule,
NbSidebarModule, NbSidebarModule,
NbTabsetModule,
NbThemeModule,
NbUserModule, NbUserModule,
NbCheckboxModule,
NbPopoverModule,
NbContextMenuModule, NbContextMenuModule,
NbProgressBarModule,
NbCalendarModule,
NbCalendarRangeModule,
NbStepperModule,
NbButtonModule, NbButtonModule,
NbInputModule,
NbAccordionModule,
NbDatepickerModule,
NbDialogModule,
NbWindowModule,
NbListModule,
NbToastrModule,
NbAlertModule,
NbSpinnerModule,
NbRadioModule,
NbSelectModule, NbSelectModule,
NbChatModule,
NbTooltipModule,
NbCalendarKitModule,
NbIconModule, NbIconModule,
NbThemeModule,
} from '@nebular/theme'; } from '@nebular/theme';
import { NbEvaIconsModule } from '@nebular/eva-icons'; import { NbEvaIconsModule } from '@nebular/eva-icons';
import { NbSecurityModule } from '@nebular/security'; import { NbSecurityModule } from '@nebular/security';
@ -53,7 +28,6 @@ import {
RoundPipe, RoundPipe,
TimingPipe, TimingPipe,
NumberWithCommasPipe, NumberWithCommasPipe,
EvaIconsPipe,
} from './pipes'; } from './pipes';
import { import {
OneColumnLayoutComponent, OneColumnLayoutComponent,
@ -64,46 +38,20 @@ import { DEFAULT_THEME } from './styles/theme.default';
import { COSMIC_THEME } from './styles/theme.cosmic'; import { COSMIC_THEME } from './styles/theme.cosmic';
import { CORPORATE_THEME } from './styles/theme.corporate'; import { CORPORATE_THEME } from './styles/theme.corporate';
const BASE_MODULES = [CommonModule, FormsModule, ReactiveFormsModule];
const NB_MODULES = [ const NB_MODULES = [
NbCardModule,
NbLayoutModule, NbLayoutModule,
NbTabsetModule,
NbRouteTabsetModule,
NbMenuModule, NbMenuModule,
NbUserModule, NbUserModule,
NbActionsModule, NbActionsModule,
NbSearchModule, NbSearchModule,
NbSidebarModule, NbSidebarModule,
NbCheckboxModule,
NbPopoverModule,
NbContextMenuModule, NbContextMenuModule,
NgbModule, NbSecurityModule,
NbSecurityModule, // *nbIsGranted directive,
NbProgressBarModule,
NbCalendarModule,
NbCalendarRangeModule,
NbStepperModule,
NbButtonModule, NbButtonModule,
NbListModule,
NbToastrModule,
NbInputModule,
NbAccordionModule,
NbDatepickerModule,
NbDialogModule,
NbWindowModule,
NbAlertModule,
NbSpinnerModule,
NbRadioModule,
NbSelectModule, NbSelectModule,
NbChatModule,
NbTooltipModule,
NbCalendarKitModule,
NbIconModule, NbIconModule,
NbEvaIconsModule, NbEvaIconsModule,
]; ];
const COMPONENTS = [ const COMPONENTS = [
HeaderComponent, HeaderComponent,
FooterComponent, FooterComponent,
@ -113,44 +61,31 @@ const COMPONENTS = [
ThreeColumnsLayoutComponent, ThreeColumnsLayoutComponent,
TwoColumnsLayoutComponent, TwoColumnsLayoutComponent,
]; ];
const PIPES = [ const PIPES = [
CapitalizePipe, CapitalizePipe,
PluralPipe, PluralPipe,
RoundPipe, RoundPipe,
TimingPipe, TimingPipe,
NumberWithCommasPipe, NumberWithCommasPipe,
EvaIconsPipe,
];
const NB_THEME_PROVIDERS = [
...NbThemeModule.forRoot(
{
name: 'default',
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME ],
).providers,
...NbSidebarModule.forRoot().providers,
...NbMenuModule.forRoot().providers,
...NbDatepickerModule.forRoot().providers,
...NbDialogModule.forRoot().providers,
...NbWindowModule.forRoot().providers,
...NbToastrModule.forRoot().providers,
...NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}).providers,
]; ];
@NgModule({ @NgModule({
imports: [...BASE_MODULES, ...NB_MODULES], imports: [CommonModule, ...NB_MODULES],
exports: [...BASE_MODULES, ...NB_MODULES, ...COMPONENTS, ...PIPES], exports: [CommonModule, ...PIPES, ...COMPONENTS],
declarations: [...COMPONENTS, ...PIPES], declarations: [...COMPONENTS, ...PIPES],
}) })
export class ThemeModule { export class ThemeModule {
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders {
return <ModuleWithProviders>{ return <ModuleWithProviders>{
ngModule: ThemeModule, ngModule: ThemeModule,
providers: [...NB_THEME_PROVIDERS], providers: [
...NbThemeModule.forRoot(
{
name: 'default',
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME ],
).providers,
],
}; };
} }
} }

View file

@ -10,7 +10,9 @@ import {
} from '@nebular/auth'; } from '@nebular/auth';
const routes: Routes = [ const routes: Routes = [
{ path: 'pages', loadChildren: () => import('app/pages/pages.module') {
path: 'pages',
loadChildren: () => import('app/pages/pages.module')
.then(m => m.PagesModule), .then(m => m.PagesModule),
}, },
{ {

View file

@ -9,11 +9,18 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
import { CoreModule } from './@core/core.module'; import { CoreModule } from './@core/core.module';
import { ThemeModule } from './@theme/theme.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { ThemeModule } from './@theme/theme.module'; import {
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; NbChatModule,
NbDatepickerModule,
NbDialogModule,
NbMenuModule,
NbSidebarModule,
NbToastrModule,
NbWindowModule,
} from '@nebular/theme';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
@ -23,8 +30,17 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
HttpClientModule, HttpClientModule,
AppRoutingModule, AppRoutingModule,
NgbModule.forRoot(),
ThemeModule.forRoot(), ThemeModule.forRoot(),
NbSidebarModule.forRoot(),
NbMenuModule.forRoot(),
NbDatepickerModule.forRoot(),
NbDialogModule.forRoot(),
NbWindowModule.forRoot(),
NbToastrModule.forRoot(),
NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}),
CoreModule.forRoot(), CoreModule.forRoot(),
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],

View file

@ -1,5 +1,5 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NbActionsModule, NbButtonModule, NbCardModule, NbTabsetModule, NbUserModule } from '@nebular/theme';
import { NgxEchartsModule } from 'ngx-echarts'; import { NgxEchartsModule } from 'ngx-echarts';
import { ThemeModule } from '../../@theme/theme.module'; import { ThemeModule } from '../../@theme/theme.module';
@ -20,10 +20,17 @@ import { SolarComponent } from './solar/solar.component';
import { PlayerComponent } from './rooms/player/player.component'; import { PlayerComponent } from './rooms/player/player.component';
import { TrafficComponent } from './traffic/traffic.component'; import { TrafficComponent } from './traffic/traffic.component';
import { TrafficChartComponent } from './traffic/traffic-chart.component'; import { TrafficChartComponent } from './traffic/traffic-chart.component';
import { FormsModule } from '@angular/forms';
@NgModule({ @NgModule({
imports: [ imports: [
FormsModule,
ThemeModule, ThemeModule,
NbCardModule,
NbUserModule,
NbButtonModule,
NbTabsetModule,
NbActionsModule,
NgxEchartsModule, NgxEchartsModule,
], ],
declarations: [ declarations: [

View file

@ -1,4 +1,5 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NbButtonModule, NbCardModule, NbProgressBarModule, NbTabsetModule, NbUserModule } from '@nebular/theme';
import { NgxEchartsModule } from 'ngx-echarts'; import { NgxEchartsModule } from 'ngx-echarts';
import { NgxChartsModule } from '@swimlane/ngx-charts'; import { NgxChartsModule } from '@swimlane/ngx-charts';
@ -49,7 +50,12 @@ import { EarningLiveUpdateChartComponent } from './earning-card/front-side/earni
@NgModule({ @NgModule({
imports: [ imports: [
ThemeModule, ThemeModule,
NbCardModule,
NbUserModule,
NbButtonModule,
NbTabsetModule,
ChartModule, ChartModule,
NbProgressBarModule,
NgxEchartsModule, NgxEchartsModule,
NgxChartsModule, NgxChartsModule,
LeafletModule, LeafletModule,

View file

@ -1,5 +1,5 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { FormsComponent } from './forms.component'; import { FormsComponent } from './forms.component';
import { FormInputsComponent } from './form-inputs/form-inputs.component'; import { FormInputsComponent } from './form-inputs/form-inputs.component';
@ -7,7 +7,8 @@ import { FormLayoutsComponent } from './form-layouts/form-layouts.component';
import { DatepickerComponent } from './datepicker/datepicker.component'; import { DatepickerComponent } from './datepicker/datepicker.component';
import { ButtonsComponent } from './buttons/buttons.component'; import { ButtonsComponent } from './buttons/buttons.component';
const routes: Routes = [{ const routes: Routes = [
{
path: '', path: '',
component: FormsComponent, component: FormsComponent,
children: [ children: [
@ -32,7 +33,8 @@ const routes: Routes = [{
component: DatepickerComponent, component: DatepickerComponent,
}, },
], ],
}]; },
];
@NgModule({ @NgModule({
imports: [ imports: [
@ -43,12 +45,5 @@ const routes: Routes = [{
], ],
}) })
export class FormsRoutingModule { export class FormsRoutingModule {
} }
export const routedComponents = [
FormsComponent,
FormInputsComponent,
FormLayoutsComponent,
DatepickerComponent,
];

View file

@ -1,17 +1,26 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { ThemeModule } from '../../@theme/theme.module'; import { ThemeModule } from '../../@theme/theme.module';
import { FormsRoutingModule, routedComponents } from './forms-routing.module'; import { FormsRoutingModule } from './forms-routing.module';
import { ButtonsModule } from './buttons/buttons.module'; import { ButtonsModule } from './buttons/buttons.module';
import { FormsComponent } from './forms.component';
import { FormInputsComponent } from './form-inputs/form-inputs.component';
import { FormLayoutsComponent } from './form-layouts/form-layouts.component';
import { DatepickerComponent } from './datepicker/datepicker.component';
import { NbInputModule } from '@nebular/theme';
@NgModule({ @NgModule({
imports: [ imports: [
ThemeModule, ThemeModule,
NbInputModule,
FormsRoutingModule, FormsRoutingModule,
ButtonsModule, ButtonsModule,
], ],
declarations: [ declarations: [
...routedComponents, FormsComponent,
FormInputsComponent,
FormLayoutsComponent,
DatepickerComponent,
], ],
}) })
export class FormsModule { } export class FormsModule { }

View file

@ -1,9 +1,17 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {
NbAccordionModule,
NbButtonModule,
NbCardModule,
NbListModule,
NbRouteTabsetModule,
NbStepperModule,
NbTabsetModule, NbUserModule,
} from '@nebular/theme';
import { ThemeModule } from '../../@theme/theme.module'; import { ThemeModule } from '../../@theme/theme.module';
import { LayoutRoutingModule } from './layout-routing.module'; import { LayoutRoutingModule } from './layout-routing.module';
// components
import { LayoutComponent } from './layout.component'; import { LayoutComponent } from './layout.component';
import { Tab1Component, Tab2Component, TabsComponent } from './tabs/tabs.component'; import { Tab1Component, Tab2Component, TabsComponent } from './tabs/tabs.component';
import { StepperComponent } from './stepper/stepper.component'; import { StepperComponent } from './stepper/stepper.component';
@ -12,10 +20,24 @@ import { InfiniteListComponent } from './infinite-list/infinite-list.component';
import { NewsPostComponent } from './infinite-list/news-post/news-post.component'; import { NewsPostComponent } from './infinite-list/news-post/news-post.component';
import { NewsPostPlaceholderComponent } from './infinite-list/news-post-placeholder/news-post-placeholder.component'; import { NewsPostPlaceholderComponent } from './infinite-list/news-post-placeholder/news-post-placeholder.component';
import { AccordionComponent } from './accordion/accordion.component'; import { AccordionComponent } from './accordion/accordion.component';
// service
import { NewsService } from './services/news.service'; import { NewsService } from './services/news.service';
const COMPONENTS = [ @NgModule({
imports: [
FormsModule,
ReactiveFormsModule,
ThemeModule,
NbTabsetModule,
NbRouteTabsetModule,
NbStepperModule,
NbCardModule,
NbButtonModule,
NbListModule,
NbAccordionModule,
NbUserModule,
LayoutRoutingModule,
],
declarations: [
LayoutComponent, LayoutComponent,
TabsComponent, TabsComponent,
Tab1Component, Tab1Component,
@ -26,26 +48,9 @@ const COMPONENTS = [
InfiniteListComponent, InfiniteListComponent,
NewsPostComponent, NewsPostComponent,
AccordionComponent, AccordionComponent,
];
const SERVICES = [
NewsService,
];
const MODULES = [
ThemeModule,
LayoutRoutingModule,
];
@NgModule({
imports: [
...MODULES,
],
declarations: [
...COMPONENTS,
], ],
providers: [ providers: [
...SERVICES, NewsService,
], ],
}) })
export class LayoutModule { } export class LayoutModule { }

View file

@ -1,27 +1,10 @@
@import '../../../@theme/styles/themes';
@import '../../../../../node_modules/bootstrap/scss/mixins/breakpoints';
@import '../../../../../node_modules/@nebular/theme/styles/global/breakpoints';
@include nb-install-component() {
nb-tabset { nb-tabset {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
nb-tab {
padding: nb-theme(padding);
}
::ng-deep ngx-tab1, ::ng-deep ngx-tab2 { ::ng-deep ngx-tab1, ::ng-deep ngx-tab2 {
display: block; display: block;
padding: nb-theme(padding); padding: 1rem 2rem;
}
@include media-breakpoint-down(xs) {
nb-tabset ::ng-deepul {
font-size: 1rem;
padding: 0 0.25rem;
}
}
} }

View file

@ -32,11 +32,11 @@ export class TabsComponent {
tabs: any[] = [ tabs: any[] = [
{ {
title: 'Route tab #1', title: 'Route tab #1',
route: '/pages/extra-components/tabs/tab1', route: '/pages/layout/tabs/tab1',
}, },
{ {
title: 'Route tab #2', title: 'Route tab #2',
route: '/pages/extra-components/tabs/tab2', route: '/pages/layout/tabs/tab2',
}, },
]; ];

View file

@ -1,25 +1,25 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { MiscellaneousComponent } from './miscellaneous.component'; import { MiscellaneousComponent } from './miscellaneous.component';
import { NotFoundComponent } from './not-found/not-found.component'; import { NotFoundComponent } from './not-found/not-found.component';
const routes: Routes = [{ const routes: Routes = [
{
path: '', path: '',
component: MiscellaneousComponent, component: MiscellaneousComponent,
children: [{ children: [
{
path: '404', path: '404',
component: NotFoundComponent, component: NotFoundComponent,
}], },
}]; ],
},
];
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],
exports: [RouterModule], exports: [RouterModule],
}) })
export class MiscellaneousRoutingModule { } export class MiscellaneousRoutingModule {
}
export const routedComponents = [
MiscellaneousComponent,
NotFoundComponent,
];

View file

@ -1,14 +1,20 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NbCardModule } from '@nebular/theme';
import { ThemeModule } from '../../@theme/theme.module'; import { ThemeModule } from '../../@theme/theme.module';
import { MiscellaneousRoutingModule, routedComponents } from './miscellaneous-routing.module'; import { MiscellaneousRoutingModule } from './miscellaneous-routing.module';
import { MiscellaneousComponent } from './miscellaneous.component';
import { NotFoundComponent } from './not-found/not-found.component';
@NgModule({ @NgModule({
imports: [ imports: [
ThemeModule, ThemeModule,
NbCardModule,
MiscellaneousRoutingModule, MiscellaneousRoutingModule,
], ],
declarations: [ declarations: [
...routedComponents, MiscellaneousComponent,
NotFoundComponent,
], ],
}) })
export class MiscellaneousModule { } export class MiscellaneousModule { }

View file

@ -38,6 +38,7 @@ export const MENU_ITEMS: NbMenuItem[] = [
}, },
{ {
title: 'Tabs', title: 'Tabs',
pathMatch: 'prefix',
link: '/pages/layout/tabs', link: '/pages/layout/tabs',
}, },
], ],

View file

@ -23,60 +23,61 @@ const routes: Routes = [{
loadChildren: () => import('./layout/layout.module') loadChildren: () => import('./layout/layout.module')
.then(m => m.LayoutModule), .then(m => m.LayoutModule),
}, },
{ // {
path: 'forms', // path: 'forms',
loadChildren: () => import('./forms/forms.module') // loadChildren: () => import('./forms/forms.module')
.then(m => m.FormsModule), // .then(m => m.FormsModule),
}, // },
{ // {
path: 'ui-features', // path: 'ui-features',
loadChildren: () => import('./ui-features/ui-features.module') // loadChildren: () => import('./ui-features/ui-features.module')
.then(m => m.UiFeaturesModule), // .then(m => m.UiFeaturesModule),
}, // },
{ // {
path: 'modal-overlays', // path: 'modal-overlays',
loadChildren: () => import('./modal-overlays/modal-overlays.module') // loadChildren: () => import('./modal-overlays/modal-overlays.module')
.then(m => m.ModalOverlaysModule), // .then(m => m.ModalOverlaysModule),
}, // },
{ // {
path: 'extra-components', // path: 'extra-components',
loadChildren: () => import('./extra-components/extra-components.module') // loadChildren: () => import('./extra-components/extra-components.module')
.then(m => m.ExtraComponentsModule), // .then(m => m.ExtraComponentsModule),
}, // },
{ // {
path: 'maps', // path: 'maps',
loadChildren: () => import('./maps/maps.module') // loadChildren: () => import('./maps/maps.module')
.then(m => m.MapsModule), // .then(m => m.MapsModule),
}, // },
{ // {
path: 'charts', // path: 'charts',
loadChildren: () => import('./charts/charts.module') // loadChildren: () => import('./charts/charts.module')
.then(m => m.ChartsModule), // .then(m => m.ChartsModule),
}, // },
{ // {
path: 'editors', // path: 'editors',
loadChildren: () => import('./editors/editors.module') // loadChildren: () => import('./editors/editors.module')
.then(m => m.EditorsModule), // .then(m => m.EditorsModule),
}, // },
{ // {
path: 'tables', // path: 'tables',
loadChildren: () => import('./tables/tables.module') // loadChildren: () => import('./tables/tables.module')
.then(m => m.TablesModule), // .then(m => m.TablesModule),
}, // },
{ // {
path: 'miscellaneous', // path: 'miscellaneous',
loadChildren: () => import('./miscellaneous/miscellaneous.module') // loadChildren: () => import('./miscellaneous/miscellaneous.module')
.then(m => m.MiscellaneousModule), // .then(m => m.MiscellaneousModule),
}, // },
{ // {
path: '', // path: '',
redirectTo: 'dashboard', // redirectTo: 'dashboard',
pathMatch: 'full', // pathMatch: 'full',
}, // },
{ {
path: '**', path: '**',
component: NotFoundComponent, component: NotFoundComponent,
}], },
],
}]; }];
@NgModule({ @NgModule({

View file

@ -1,26 +1,24 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NbMenuModule } from '@nebular/theme';
import { ThemeModule } from '../@theme/theme.module';
import { PagesComponent } from './pages.component'; import { PagesComponent } from './pages.component';
import { DashboardModule } from './dashboard/dashboard.module'; import { DashboardModule } from './dashboard/dashboard.module';
import { ECommerceModule } from './e-commerce/e-commerce.module'; import { ECommerceModule } from './e-commerce/e-commerce.module';
import { PagesRoutingModule } from './pages-routing.module'; import { PagesRoutingModule } from './pages-routing.module';
import { ThemeModule } from '../@theme/theme.module';
import { MiscellaneousModule } from './miscellaneous/miscellaneous.module'; import { MiscellaneousModule } from './miscellaneous/miscellaneous.module';
const PAGES_COMPONENTS = [
PagesComponent,
];
@NgModule({ @NgModule({
imports: [ imports: [
PagesRoutingModule, PagesRoutingModule,
ThemeModule, ThemeModule,
NbMenuModule,
DashboardModule, DashboardModule,
ECommerceModule, ECommerceModule,
MiscellaneousModule, MiscellaneousModule,
], ],
declarations: [ declarations: [
...PAGES_COMPONENTS, PagesComponent,
], ],
}) })
export class PagesModule { export class PagesModule {