Add preloadingStrategy PreloadAllModules

This commit is contained in:
Sebastian
2020-04-08 11:28:06 +02:00
parent 9b346377cb
commit f4e6c5d171

View File

@@ -1,5 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { LogInComponent } from './components/log-in/log-in.component';
import { DashboardComponent } from './modules/dashboard/pages/dashboard.component';
@@ -8,22 +8,43 @@ const routes: Routes = [
path: 'login',
children: [
{ path: '', component: LogInComponent, pathMatch: 'full' },
{ path: ':token', component: LogInComponent }
]
{ path: ':token', component: LogInComponent },
],
},
{ path: 'dashboard', component: DashboardComponent },
{ path: 'product', loadChildren: './modules/product/product.module#ProductModule' },
{ path: 'customer', loadChildren: './modules/customer/customer.module#CustomerModule' },
{ path: 'branch', loadChildren: './modules/branch/branch.module#BranchModule' },
{
path: 'product',
loadChildren: './modules/product/product.module#ProductModule',
},
{
path: 'customer',
loadChildren: './modules/customer/customer.module#CustomerModule',
},
{
path: 'branch',
loadChildren: './modules/branch/branch.module#BranchModule',
},
{ path: 'shelf', loadChildren: './modules/shelf/shelf.module#ShelfModule' },
{ path: 'cart', loadChildren: './modules/cart/cart.module#CartModule' },
{ path: 'debug', loadChildren: './modules/debug/debug.module#DebugModule' },
{ path: 'goodsin', loadChildren: './modules/goods-in/goods-in.module#GoodsInModule' },
{ path: 'remission', loadChildren: './modules/remission/remission-client.module#RemissionClientModule' }
{
path: 'goodsin',
loadChildren: './modules/goods-in/goods-in.module#GoodsInModule',
},
{
path: 'remission',
loadChildren:
'./modules/remission/remission-client.module#RemissionClientModule',
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled' })],
exports: [RouterModule]
imports: [
RouterModule.forRoot(routes, {
preloadingStrategy: PreloadAllModules,
scrollPositionRestoration: 'enabled',
}),
],
exports: [RouterModule],
})
export class AppRoutingModule {}